From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE56CC25B0E for ; Mon, 15 Aug 2022 14:18:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242851AbiHOOSO (ORCPT ); Mon, 15 Aug 2022 10:18:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242847AbiHOOSK (ORCPT ); Mon, 15 Aug 2022 10:18:10 -0400 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 242B221808; Mon, 15 Aug 2022 07:18:08 -0700 (PDT) Received: from unknown (HELO kinkan2-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 15 Aug 2022 23:18:07 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan2-ex.css.socionext.com (Postfix) with ESMTP id E63C92059027; Mon, 15 Aug 2022 23:18:06 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Mon, 15 Aug 2022 23:18:06 +0900 Received: from [10.212.182.72] (unknown [10.212.182.72]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 1CC63B62A4; Mon, 15 Aug 2022 23:18:05 +0900 (JST) Subject: Re: [PATCH v5 04/33] thermal/drivers/uniphier: Switch to new of API To: Daniel Lezcano , 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, 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 , "moderated list:ARM/UNIPHIER ARCHITECTURE" References: <20220804224349.1926752-1-daniel.lezcano@linexp.org> <20220804224349.1926752-5-daniel.lezcano@linexp.org> From: Kunihiko Hayashi Message-ID: Date: Mon, 15 Aug 2022 23:18:04 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20220804224349.1926752-5-daniel.lezcano@linexp.org> Content-Type: text/plain; charset=iso-2022-jp; format=flowed; delsp=yes Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/08/05 7:43, Daniel Lezcano wrote: > 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 Reviewed-by: Kunihiko Hayashi > --- > drivers/thermal/uniphier_thermal.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/thermal/uniphier_thermal.c > b/drivers/thermal/uniphier_thermal.c > index 4cae5561a2a3..4111d99ef50e 100644 > --- a/drivers/thermal/uniphier_thermal.c > +++ b/drivers/thermal/uniphier_thermal.c > @@ -187,9 +187,9 @@ static void uniphier_tm_disable_sensor(struct > uniphier_tm_dev *tdev) > usleep_range(1000, 2000); /* The spec note says at least 1ms > */ > } > > -static int uniphier_tm_get_temp(void *data, int *out_temp) > +static int uniphier_tm_get_temp(struct thermal_zone_device *tz, int > *out_temp) > { > - struct uniphier_tm_dev *tdev = data; > + struct uniphier_tm_dev *tdev = tz->devdata; > struct regmap *map = tdev->regmap; > int ret; > u32 temp; > @@ -204,7 +204,7 @@ static int uniphier_tm_get_temp(void *data, int > *out_temp) > return 0; > } > > -static const struct thermal_zone_of_device_ops uniphier_of_thermal_ops = > { > +static const struct thermal_zone_device_ops uniphier_of_thermal_ops = { > .get_temp = uniphier_tm_get_temp, > }; > > @@ -289,8 +289,8 @@ static int uniphier_tm_probe(struct platform_device > *pdev) > > platform_set_drvdata(pdev, tdev); > > - tdev->tz_dev = devm_thermal_zone_of_sensor_register(dev, 0, tdev, > - &uniphier_of_thermal_ops); > + tdev->tz_dev = devm_thermal_of_zone_register(dev, 0, tdev, > + > &uniphier_of_thermal_ops); > if (IS_ERR(tdev->tz_dev)) { > dev_err(dev, "failed to register sensor device\n"); > return PTR_ERR(tdev->tz_dev); > --- Best Regards Kunihiko Hayashi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35B5DC00140 for ; Mon, 15 Aug 2022 14:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sjHLV832o58uVadSolYnoBJObUqzUIO5yjGvFaA5HeM=; b=KZVdKi+cNAgX6Rl3H4ky7rMq71 BZXh2FSvn4sxearC8Jrlrk5I9+Vz2g6qOqcZ4wVI+VfftRHrhzmKAyyjFwVz+TCKbNSFNeaM1h6mU ABuYAypsPmlAKB5/3Q01p+IgIg90hy6Dd8/5wzgWnazXZWAkjEDsJu6LWMEbN3Y86jTtjSuRspDgp pa/jfSHXI+p/OZ/cE6qQfNf0npQrInQaomnICPJyOz8g1NS9UurdcJybsOmprMSe+y+fjeVJI8/bZ OGOHbqdeXDw4QtBnPguptwvaM9cePJEniCEQXVjAyEqgyssz0Wl6outv5OQn6hlW+pnjOH2rh2Ujd 0sDMOavw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNbDJ-000Ap0-6T; Mon, 15 Aug 2022 14:37:09 +0000 Received: from mx.socionext.com ([202.248.49.38]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNauy-00HQhG-QG for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2022 14:18:14 +0000 Received: from unknown (HELO kinkan2-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 15 Aug 2022 23:18:07 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan2-ex.css.socionext.com (Postfix) with ESMTP id E63C92059027; Mon, 15 Aug 2022 23:18:06 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Mon, 15 Aug 2022 23:18:06 +0900 Received: from [10.212.182.72] (unknown [10.212.182.72]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 1CC63B62A4; Mon, 15 Aug 2022 23:18:05 +0900 (JST) Subject: Re: [PATCH v5 04/33] thermal/drivers/uniphier: Switch to new of API To: Daniel Lezcano , 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, 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 , "moderated list:ARM/UNIPHIER ARCHITECTURE" References: <20220804224349.1926752-1-daniel.lezcano@linexp.org> <20220804224349.1926752-5-daniel.lezcano@linexp.org> From: Kunihiko Hayashi Message-ID: Date: Mon, 15 Aug 2022 23:18:04 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20220804224349.1926752-5-daniel.lezcano@linexp.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220815_071813_020227_527C83EA X-CRM114-Status: GOOD ( 23.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022/08/05 7:43, Daniel Lezcano wrote: > 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 Reviewed-by: Kunihiko Hayashi > --- > drivers/thermal/uniphier_thermal.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/thermal/uniphier_thermal.c > b/drivers/thermal/uniphier_thermal.c > index 4cae5561a2a3..4111d99ef50e 100644 > --- a/drivers/thermal/uniphier_thermal.c > +++ b/drivers/thermal/uniphier_thermal.c > @@ -187,9 +187,9 @@ static void uniphier_tm_disable_sensor(struct > uniphier_tm_dev *tdev) > usleep_range(1000, 2000); /* The spec note says at least 1ms > */ > } > > -static int uniphier_tm_get_temp(void *data, int *out_temp) > +static int uniphier_tm_get_temp(struct thermal_zone_device *tz, int > *out_temp) > { > - struct uniphier_tm_dev *tdev = data; > + struct uniphier_tm_dev *tdev = tz->devdata; > struct regmap *map = tdev->regmap; > int ret; > u32 temp; > @@ -204,7 +204,7 @@ static int uniphier_tm_get_temp(void *data, int > *out_temp) > return 0; > } > > -static const struct thermal_zone_of_device_ops uniphier_of_thermal_ops = > { > +static const struct thermal_zone_device_ops uniphier_of_thermal_ops = { > .get_temp = uniphier_tm_get_temp, > }; > > @@ -289,8 +289,8 @@ static int uniphier_tm_probe(struct platform_device > *pdev) > > platform_set_drvdata(pdev, tdev); > > - tdev->tz_dev = devm_thermal_zone_of_sensor_register(dev, 0, tdev, > - &uniphier_of_thermal_ops); > + tdev->tz_dev = devm_thermal_of_zone_register(dev, 0, tdev, > + > &uniphier_of_thermal_ops); > if (IS_ERR(tdev->tz_dev)) { > dev_err(dev, "failed to register sensor device\n"); > return PTR_ERR(tdev->tz_dev); > --- Best Regards Kunihiko Hayashi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel