Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2183870imn; Mon, 1 Aug 2022 14:27:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR7o15s2KFA6vTfzjonqm68vYgicvZyof+r50etDMBLccdQWln6M7MbqHoG2zPXaiFjcfA7z X-Received: by 2002:a17:902:70c4:b0:16c:5306:9172 with SMTP id l4-20020a17090270c400b0016c53069172mr18256587plt.171.1659389233100; Mon, 01 Aug 2022 14:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659389233; cv=none; d=google.com; s=arc-20160816; b=AB77JIrH6J06ujc+hNiOhcof4b6ll/RDBFyKruOxSsVOdCcSZhow9bAiKOu//yA8/n ybS4dystMxrt4gPQ+/clFBkaKJKGCyT7WSaP7SDyvp5UR5p6gt5oX3/RyfhGTwbmm13+ mz4j1gLYhfci1ixIRAFOv1cOIsZ7/4mUmnbI3z56QRqP6gb0vx9GKrzQdKHHIyW/S1JH 2bujVfcK6BAXa3RNyOet7P+rnSNzdr2rClS8M168NEg2852t2Mr+KWdmXhmnnv34/LNb b8PCobDBIg2qeY7U0DfIlpXYCiUcLIWl6TtfC9Uc1ZnzJ7+l2WHAGQ4Fp7IdaNNrmHFG qEnw== 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=yKzLkry3f0ucVVy+WiLh8Z5rguSF04AWiaZnad/6qXc=; b=ojZMBxKUkHKBTeqlp5GdfjTzkX4s5YCQef70k/Vo1RaXIPsuzaH1GMCV9X2C+DW6Ii VZr42azVXDiAbjM3tgzgUC+ErHJTt56k3xj4CoEVUP46jpruNPsCADaekG/fjSJ6ZuxT C4BP0exC+fA2WuQ8tWEGDrr5MUN+4x/Xt85sIEWe4n4h5PbUsbuw+uQOt/vhbHDHYQ8n s72Ci4fCcsnJfjqFKnYoLh41vEg8CmdfBohtv4QTkalTXb892f4ljZIEkZ5mJqc/FMYn EnKFMEC1y4LuE66s3JOrs/evj99cmksp7zhX3HxLxiSJ/7z4CC3SvqC/ESaUJTUrHzSz DT+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=RlYDEyOL; 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 u16-20020a170903125000b0016bf48465e7si15519257plh.380.2022.08.01.14.26.58; Mon, 01 Aug 2022 14:27:13 -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=RlYDEyOL; 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 S235317AbiHAVZe (ORCPT + 99 others); Mon, 1 Aug 2022 17:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234953AbiHAVYj (ORCPT ); Mon, 1 Aug 2022 17:24:39 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F16A547BB3 for ; Mon, 1 Aug 2022 14:23:57 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id a11so6357095wmq.3 for ; Mon, 01 Aug 2022 14:23:57 -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=yKzLkry3f0ucVVy+WiLh8Z5rguSF04AWiaZnad/6qXc=; b=RlYDEyOLTn9hR8GbxO4HfvwR9tD7RcncP0fiMcrDNJkB8b/be5R5Q07lEiKeNY+WfB vE/qEnkAC9wjTwWpEpXrkxaSby9VY6vYkkRKeJ8Obq8XGtBjBK6RYFqhfVa0ifoIv/16 z8DQFAcxhOG2ygmhtiTR2iJmjteQ3sDty8iN36ibOQXP8CSiS/ABVYwBwJQ9k05Y5biU 4BVXtJEtww4TE1suSCe34YTOUwA2WXmFISzwlUT/LeI0MhiDg1SokSmp9sA7/INMbGuF wtwUJNQcVArg3OZt7mddWwjUcs9tiQ3k2xiIMUSvjQAEhIoqgGECN2IWqe7S5vYVtCEb 981A== 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=yKzLkry3f0ucVVy+WiLh8Z5rguSF04AWiaZnad/6qXc=; b=rDPfLwv2PijmYyqddl2qmTWIkbfmMG0VvmdPp2fAt7B0P9GDoBKbatC+ptPY7N4q3i cZsVvzcumQxrUro92fP7k2RY2/xd2KBKYU1WeZVdD3p5GvRD5DV58SIhEKPTfhL70aWw aevIXTbP+A3IdLaAsGAw1BEyTcu+zAseBTai05bOxeG4ci97SI3tdaO0PT+C0FXcL6Nd gVxO4ixAStImK0qjztWbV6mzkvLn4IlHDSeYyB/SzEghfNFHK9Vyq0NcdO8rhaCJb7m0 6x7xzofQ4dV+jwF4LqcE+IUjgQNPWbK7B8JlMALikwCo+9xCZUR0ToQn29NUqBYIB+Nf yNpA== X-Gm-Message-State: AJIora9XQO3K5SzKCFroey+CcueL1Y5UFe3sLuqUVEadfdSEae8Rt2Nm HYUMilhn/9LI0HT8itL4JYfpag== X-Received: by 2002:a1c:7213:0:b0:3a3:155a:dd5d with SMTP id n19-20020a1c7213000000b003a3155add5dmr11708431wmc.178.1659389035073; Mon, 01 Aug 2022 14:23:55 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:d00:ceb8:9c09:1302]) by smtp.gmail.com with ESMTPSA id c7-20020adffb07000000b0021e501519d3sm12995285wrr.67.2022.08.01.14.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 14:23:54 -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, Amit Kucheria Subject: [PATCH v4 21/32] thermal/drivers/banggap: Switch to new of API Date: Mon, 1 Aug 2022 23:22:33 +0200 Message-Id: <20220801212244.1124867-22-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220801212244.1124867-1-daniel.lezcano@linexp.org> References: <20220801212244.1124867-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=ham 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 --- drivers/thermal/k3_bandgap.c | 12 ++++++------ drivers/thermal/k3_j72xx_bandgap.c | 12 +++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c index 5d0b3ffc6f46..22c9bcb899c3 100644 --- a/drivers/thermal/k3_bandgap.c +++ b/drivers/thermal/k3_bandgap.c @@ -139,9 +139,9 @@ static int k3_bgp_read_temp(struct k3_thermal_data *devdata, return 0; } -static int k3_thermal_get_temp(void *devdata, int *temp) +static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { - struct k3_thermal_data *data = devdata; + struct k3_thermal_data *data = tz->devdata; int ret = 0; ret = k3_bgp_read_temp(data, temp); @@ -151,7 +151,7 @@ static int k3_thermal_get_temp(void *devdata, int *temp) return ret; } -static const struct thermal_zone_of_device_ops k3_of_thermal_ops = { +static const struct thermal_zone_device_ops k3_of_thermal_ops = { .get_temp = k3_thermal_get_temp, }; @@ -213,9 +213,9 @@ static int k3_bandgap_probe(struct platform_device *pdev) writel(val, data[id].bgp->base + data[id].ctrl_offset); data[id].tzd = - devm_thermal_zone_of_sensor_register(dev, id, - &data[id], - &k3_of_thermal_ops); + devm_thermal_of_zone_register(dev, id, + &data[id], + &k3_of_thermal_ops); if (IS_ERR(data[id].tzd)) { dev_err(dev, "thermal zone device is NULL\n"); ret = PTR_ERR(data[id].tzd); diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index 115a44eb4fbf..16b6bcf1bf4f 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -247,9 +247,9 @@ static inline int k3_bgp_read_temp(struct k3_thermal_data *devdata, } /* Get temperature callback function for thermal zone */ -static int k3_thermal_get_temp(void *devdata, int *temp) +static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { - struct k3_thermal_data *data = devdata; + struct k3_thermal_data *data = tz->devdata; int ret = 0; ret = k3_bgp_read_temp(data, temp); @@ -259,7 +259,7 @@ static int k3_thermal_get_temp(void *devdata, int *temp) return ret; } -static const struct thermal_zone_of_device_ops k3_of_thermal_ops = { +static const struct thermal_zone_device_ops k3_of_thermal_ops = { .get_temp = k3_thermal_get_temp, }; @@ -474,10 +474,8 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) writel(val, data[id].bgp->cfg2_base + data[id].ctrl_offset); bgp->ts_data[id] = &data[id]; - ti_thermal = - devm_thermal_zone_of_sensor_register(bgp->dev, id, - &data[id], - &k3_of_thermal_ops); + ti_thermal = devm_thermal_of_zone_register(bgp->dev, id, &data[id], + &k3_of_thermal_ops); if (IS_ERR(ti_thermal)) { dev_err(bgp->dev, "thermal zone device is NULL\n"); ret = PTR_ERR(ti_thermal); -- 2.25.1