From: Neil Armstrong <narmstrong@baylibre.com>
To: Daniel Lezcano <daniel.lezcano@linexp.org>,
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 <amitk@kernel.org>,
"open list:THERMAL DRIVER FOR AMLOGIC SOCS"
<linux-amlogic@lists.infradead.org>
Subject: Re: [PATCH v5 13/33] thermal/drivers/amlogic: Switch to new of API
Date: Mon, 8 Aug 2022 10:07:52 +0200 [thread overview]
Message-ID: <bd18d0ea-10b9-4fc6-3f3e-ace336bd796f@baylibre.com> (raw)
In-Reply-To: <20220804224349.1926752-14-daniel.lezcano@linexp.org>
On 05/08/2022 00: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 <daniel.lezcano@linexp.org>
> ---
> drivers/thermal/amlogic_thermal.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
> index e61b91d14ad1..d30cb791e63c 100644
> --- a/drivers/thermal/amlogic_thermal.c
> +++ b/drivers/thermal/amlogic_thermal.c
> @@ -179,12 +179,12 @@ static int amlogic_thermal_disable(struct amlogic_thermal *data)
> return 0;
> }
>
> -static int amlogic_thermal_get_temp(void *data, int *temp)
> +static int amlogic_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
> {
> unsigned int tval;
> - struct amlogic_thermal *pdata = data;
> + struct amlogic_thermal *pdata = tz->devdata;
>
> - if (!data)
> + if (!pdata)
> return -EINVAL;
>
> regmap_read(pdata->regmap, TSENSOR_STAT0, &tval);
> @@ -195,7 +195,7 @@ static int amlogic_thermal_get_temp(void *data, int *temp)
> return 0;
> }
>
> -static const struct thermal_zone_of_device_ops amlogic_thermal_ops = {
> +static const struct thermal_zone_device_ops amlogic_thermal_ops = {
> .get_temp = amlogic_thermal_get_temp,
> };
>
> @@ -276,10 +276,10 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
> return PTR_ERR(pdata->sec_ao_map);
> }
>
> - pdata->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev,
> - 0,
> - pdata,
> - &amlogic_thermal_ops);
> + pdata->tzd = devm_thermal_of_zone_register(&pdev->dev,
> + 0,
> + pdata,
> + &amlogic_thermal_ops);
> if (IS_ERR(pdata->tzd)) {
> ret = PTR_ERR(pdata->tzd);
> dev_err(dev, "Failed to register tsensor: %d\n", ret);
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
prev parent reply other threads:[~2022-08-08 8:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220804224349.1926752-1-daniel.lezcano@linexp.org>
2022-08-04 22:43 ` [PATCH v5 13/33] thermal/drivers/amlogic: Switch to new of API Daniel Lezcano
2022-08-08 8:07 ` Neil Armstrong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bd18d0ea-10b9-4fc6-3f3e-ace336bd796f@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=abailon@baylibre.com \
--cc=amitk@kernel.org \
--cc=anarsoul@gmail.com \
--cc=baolin.wang7@gmail.com \
--cc=bjorn.andersson@linaro.org \
--cc=broonie@kernel.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=daniel.lezcano@linaro.org \
--cc=daniel.lezcano@linexp.org \
--cc=digetx@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=glaroque@baylibre.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=heiko@sntech.de \
--cc=j-keerthy@ti.com \
--cc=jonathanh@nvidia.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=mhiramat@kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=niklas.soderlund@ragnatech.se \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=shawnguo@kernel.org \
--cc=talel@amazon.com \
--cc=thierry.reding@gmail.com \
--cc=tiny.windzz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox