Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp40790imn; Wed, 27 Jul 2022 14:35:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uHUES0NE9Sqxu5Yxhj9WowHx6rXNBO9aGQ4/XLYOHKxUKpefS5hie8+yyfQ1GlwpX0izpH X-Received: by 2002:a63:86c2:0:b0:415:eb:d166 with SMTP id x185-20020a6386c2000000b0041500ebd166mr20129277pgd.124.1658957725069; Wed, 27 Jul 2022 14:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658957725; cv=none; d=google.com; s=arc-20160816; b=p5C8O2td02OxlIAWe5/AfRfGffq59kXiPBidmm6ubhGniTWuupD046pQHCvAkzr+V5 uqXJbfPt7UV5Pct7ViReSXKQmPFFmsZCH5GfhdzTPDgfGOw4fmnBHQz/NPTkQ1+bQvlM k7vO03uc4dsagh/4q5DzO0LEbvPFjAlL0vIi64H5ImiAHrHhlFZOxR/pT/zThlMSJzkA +zBlgpD4BkI4daFtiiVYdMC+759k2EoS4RRvDqvdv6vjoYRyeUh6J4YtlTLkCY4g5Cbj QUKNIoeg+5yIAGzJkIHHEZRhW912qb7Jx5r7MPkXgNvAJp8aUjhyH39FKbJrAvP058CP iC1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fQwrODMneSzL3hNZushZmArM7t54Sdd+4j1p+OO3JS8=; b=dMOXDxyTFbp5j0vCBVLdoTHdA3tUBNXpFR9rmKVMKKRaTxVcfhn6rfKgoiD2E+Dlks OtBGgdVpomHap+Mj++1BXJAnuY3suDwTQFLgkRK62SFd8AA/m4oXA9pC+8v0xuHx8az8 x5BFCV+5v6sFnKvWP/TAQ3VdO8P+BDm7H8XDn18f1agNuI0bWyZwuiYCiJnWMYsD85yV uI52Y7tqFyAPbLRcrc5GaYLeA5s8RJ8rjhdzSoEe/69dRBDu1xw8F3X8vY+VmvxGPjxx C4+usv48eme7c9jZVGErs0k/M104B1JV3HiHullnSvkQ3JGCCkE6Vuk3etwiHEsG21KV KfDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=ffvsBioq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a17090311c400b0016d2c5285e4si23505990plh.413.2022.07.27.14.34.55; Wed, 27 Jul 2022 14:35:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=ffvsBioq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236816AbiG0VFW (ORCPT + 99 others); Wed, 27 Jul 2022 17:05:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235293AbiG0VEY (ORCPT ); Wed, 27 Jul 2022 17:04:24 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9121E606A9 for ; Wed, 27 Jul 2022 14:04:07 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id k11so25627275wrx.5 for ; Wed, 27 Jul 2022 14:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fQwrODMneSzL3hNZushZmArM7t54Sdd+4j1p+OO3JS8=; b=ffvsBioqqTK3v5XHBc8wI1FNEys0b05prCWWYQB0YJfH9vPoQpT9lM3vMc/YC8uktE Pc6Qzclhv74Iw7MB3B1YV2A6dh6SiTlrsBy8PcgGbcH/83f2GOV2vertbN1WNQTr9Vs8 CukW8ksaHHH9JkkO+VMC9v91wH54fFHkhjWwGKpTugpoz34qqsmYNINA3tz0yGCKv1s5 U4t0JQ1tKsvAJ5DbhgPacyAdzGft7eST0CIltom+ojNJZaD5vijOITQ7YqjEDcPqE/g1 19ip07LGGtVB0UeTk24pdVbtb+623Q/kghSkVcrxJeiFawwAkVY6R3cha1liIyR2Pswj 0b8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fQwrODMneSzL3hNZushZmArM7t54Sdd+4j1p+OO3JS8=; b=do7eAbrNkkuQ47DL7G9RbzpF1XwI7uGqBUlEPrFM59SJndAkdeygcLeEpqdWpcuevM NZeeOBUXE20cGjPFGVmUIfsRb/HCK840PtA7thVO3Y7ghmt3c5FnDpJsrHoYlahrr1/g 7Kcfk3BN6WkdkbGpgel8icIvP/xIq8B542g+CAj4rmPWDXont49nNBSFtj3Am2yk2Kfk cYeO23QmHWwEPPiSlcSM3pHMCXsdwvyGjLvr+TcbxFOsBOZOhDSAjLv4iMWZNYLkd0lO lYY/IHWy09MKOygRdaGjxRDtnz/AFpp7mWnD1f1cfTjiCEuTIL4iiDapX3djVUm/pOB7 bE+Q== X-Gm-Message-State: AJIora8/TUCHzTDvHN9vjQqQL7hV25EqYEBAmSoh/TjSOeyrB7IY56uj WfqYbVu9LlBuZ7RbMJ/iA3XzTQ== X-Received: by 2002:a05:6000:1548:b0:21d:acfc:29f5 with SMTP id 8-20020a056000154800b0021dacfc29f5mr14745388wry.520.1658955846994; Wed, 27 Jul 2022 14:04:06 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:65a8:ebd8:4098:d9d0]) by smtp.gmail.com with ESMTPSA id h6-20020a05600c350600b003a38606385esm37908wmq.3.2022.07.27.14.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 14:04:06 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, abailon@baylibre.com, lukasz.luba@arm.com, broonie@kernel.org, damien.lemoal@opensource.wdc.com, heiko@sntech.de, hayashi.kunihiko@socionext.com, mhiramat@kernel.org, talel@amazon.com, thierry.reding@gmail.com, digetx@gmail.com, jonathanh@nvidia.com, anarsoul@gmail.com, tiny.windzz@gmail.com, baolin.wang7@gmail.com, f.fainelli@gmail.com, bjorn.andersson@linaro.org, mcoquelin.stm32@gmail.com, glaroque@baylibre.com, miquel.raynal@bootlin.com, shawnguo@kernel.org, niklas.soderlund@ragnatech.se, matthias.bgg@gmail.com, j-keerthy@ti.com, Eduardo Valentin , Amit Kucheria , linux-omap@vger.kernel.org (open list:TI BANDGAP AND THERMAL DRIVER) Subject: [PATCH v3 24/32] thermal/drivers/ti-soc: Switch to new of API Date: Wed, 27 Jul 2022 23:02:45 +0200 Message-Id: <20220727210253.3794069-25-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220727210253.3794069-1-daniel.lezcano@linexp.org> References: <20220727210253.3794069-1-daniel.lezcano@linexp.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano --- .../thermal/ti-soc-thermal/ti-thermal-common.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c index 703039d8b937..8a9055bd376e 100644 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c @@ -65,10 +65,10 @@ static inline int ti_thermal_hotspot_temperature(int t, int s, int c) /* thermal zone ops */ /* Get temperature callback function for thermal zone */ -static inline int __ti_thermal_get_temp(void *devdata, int *temp) +static inline int __ti_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { struct thermal_zone_device *pcb_tz = NULL; - struct ti_thermal_data *data = devdata; + struct ti_thermal_data *data = tz->devdata; struct ti_bandgap *bgp; const struct ti_temp_sensor *s; int ret, tmp, slope, constant; @@ -85,8 +85,8 @@ static inline int __ti_thermal_get_temp(void *devdata, int *temp) return ret; /* Default constants */ - slope = thermal_zone_get_slope(data->ti_thermal); - constant = thermal_zone_get_offset(data->ti_thermal); + slope = thermal_zone_get_slope(tz); + constant = thermal_zone_get_offset(tz); pcb_tz = data->pcb_tz; /* In case pcb zone is available, use the extrapolation rule with it */ @@ -107,9 +107,9 @@ static inline int __ti_thermal_get_temp(void *devdata, int *temp) return ret; } -static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend) +static int __ti_thermal_get_trend(struct thermal_zone_device *tz, int trip, enum thermal_trend *trend) { - struct ti_thermal_data *data = p; + struct ti_thermal_data *data = tz->devdata; struct ti_bandgap *bgp; int id, tr, ret = 0; @@ -130,7 +130,7 @@ static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend) return 0; } -static const struct thermal_zone_of_device_ops ti_of_thermal_ops = { +static const struct thermal_zone_device_ops ti_of_thermal_ops = { .get_temp = __ti_thermal_get_temp, .get_trend = __ti_thermal_get_trend, }; @@ -170,7 +170,7 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, return -EINVAL; /* in case this is specified by DT */ - data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id, + data->ti_thermal = devm_thermal_of_zone_register(bgp->dev, id, data, &ti_of_thermal_ops); if (IS_ERR(data->ti_thermal)) { dev_err(bgp->dev, "thermal zone device is NULL\n"); -- 2.25.1