Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1027785rwb; Thu, 4 Aug 2022 15:57:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR778Tp2051tCwP1jRt7wIb6t8CeZO+VwW0WVDMn1XpOR1grHKH3BT9z9N+kdKPGZQjVRBbI X-Received: by 2002:a05:6402:424e:b0:43d:9d9f:38f9 with SMTP id g14-20020a056402424e00b0043d9d9f38f9mr4109613edb.411.1659653847635; Thu, 04 Aug 2022 15:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659653847; cv=none; d=google.com; s=arc-20160816; b=tLwWOj9LlessXipFiVyM0+kCWexRxLliPQt5m2xCbOijSixhasn9OGFXeVcBVpaeZC /BLRv+/T4cBCSBbVqFUVrNPG28bUhJPuru7KHowhy+2n2D5y6b4H7thWx1Mm4LoSceAr cQx/bYR1/VDwbglex0MORVgMg3IqrmRw0Y+mK6lODQNcARu8z8QBNWDSehLlerpi0LkC oyxh8CWTjKB5JnWwEULnnbo+7PJLjv6/CQbzpAdMPwtyVz1OB3wNV5XD2iD9VthILYWC riZKVms4cWan1pkE0g6RyheJgbnMXalT1fc6fQIQnn32eTQkNjbsPBR/rkSvD0ymeh7T WxyA== 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=tKnxN7t12ReAKj/48it+OmHu/wdu0SCAQqJLI5oLacueryfMd3fuV6OQW//DQFToJx zA6DYfan1LCtWn09Y6WF41cJ+ZCkvg9hBhgUBLYq6qvBBdCD/7Q+EjSSh0bo0abbGAZn lTJurxz8uKTUuhXONBW/LWEYYmEpvQ/0n8xO9BhQouIUDueUmud2/jfgQSAAK6DLBbH1 sfiMp0E39AIoQU2Iwm1Al7QCN4mFyN0seyffz1KHBE2iZ55JbJbkE3o6xIfAI0lLi60/ s7gQ+0p0BYare1+WhdS9dRZwQJoHPcMNEkS5TfqmIt4CcWLJTz3BKZ3NpW0qBxOPS/Q6 96pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=du0U1yNv; 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 f13-20020a056402194d00b004377e09fb70si2338282edz.551.2022.08.04.15.57.02; Thu, 04 Aug 2022 15:57:27 -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=du0U1yNv; 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 S240209AbiHDWyv (ORCPT + 99 others); Thu, 4 Aug 2022 18:54:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240156AbiHDWyC (ORCPT ); Thu, 4 Aug 2022 18:54:02 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EB1574361 for ; Thu, 4 Aug 2022 15:52:54 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso3172670wma.2 for ; Thu, 04 Aug 2022 15:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=fQwrODMneSzL3hNZushZmArM7t54Sdd+4j1p+OO3JS8=; b=du0U1yNvWqPDOLaD9/Y8e2EHjChbPfu2bij7Evl0yVU/i9/mMb1oF1T6TpbGAj5zdU rrbD3I65hi7nREk9+kUuEOTazN7fRYqcURJCPUEfB9+niqI6/ZjieaXoCMoDI8ege/Z7 sHpzoVL0pCH/zEMlRjGF1Yf6T4uWklDCSN7hbyK8LpMF9JM/e4/UMASJ9Lr0QVyurGhL p/B2/aQcqStizpp3/Eyo8Kzw4skoUOcrY9YoUG4sXPnRavucHFb/LkzyN51QxrC8Af2K TzZ4cK2LxAvvK/pnKMpwH/VyMRZwpYen+XJson4vn+e5rk3b5NBLWF8pcnnSwfC7O3NX +7xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=fQwrODMneSzL3hNZushZmArM7t54Sdd+4j1p+OO3JS8=; b=p9oEIje+Tab8DTfVbxC//0jgPFucrok3j4dZfB35V97g267nYggIutWlxR2RJF8Fpx Vb+VOp/0XTwQR0PdCN6Xst2KIQnlKm/ZYe9Vu+lwi6lD/bWPb3k0fN93Y9+ZbTeruN4P 4RMNFzuoxXvTXyPihjFf+4y75zsflXLjgRVO8zCnu89CDwLr7gwi5gosO2ijhwN2dDYj ccBXRbQ8E4YolSUw5FWBMcO/ocNPR4HmKHZX1+0ecY1TZyfu0s8wAWz31i8SNgVW43Db 9ugugAfJpbmRmunCQ34CZN0X2VyTTMO/2l2XdYmRszKqa87SuqxYVn7KXJsGk7dSiahU +bZA== X-Gm-Message-State: ACgBeo2y0F6DJFfKBHvEr4Xw1a/MedFYDFyD11JFMRBnBMs639uFcPMo 7ueAWv+O4OuOjBf8W7JhYz2OSg== X-Received: by 2002:a1c:7401:0:b0:3a3:182f:7be9 with SMTP id p1-20020a1c7401000000b003a3182f7be9mr7393098wmc.189.1659653572336; Thu, 04 Aug 2022 15:52:52 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:31aa:ed2c:3f7:19d]) by smtp.gmail.com with ESMTPSA id a16-20020a056000051000b0021f87e8945asm2495906wrf.12.2022.08.04.15.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 15:52:52 -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 v5 24/33] thermal/drivers/ti-soc: Switch to new of API Date: Fri, 5 Aug 2022 00:43:40 +0200 Message-Id: <20220804224349.1926752-25-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804224349.1926752-1-daniel.lezcano@linexp.org> References: <20220804224349.1926752-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