ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Daniel Lezcano <daniel.lezcano@linexp.org>
Cc: daniel.lezcano@linaro.org, rafael@kernel.org,
	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,
	Lars-Peter Clausen <lars@metafoo.de>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	linux-iio@vger.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS),
	linux-arm-kernel@lists.infradead.org (moderated
	list:ARM/Allwinner sunXi SoC support),
	linux-sunxi@lists.linux.dev (open list:ARM/Allwinner sunXi SoC
	support)
Subject: Re: [PATCH v3 27/32] iio/drivers/sun4i_gpadc: Switch to new of thermal API
Date: Sun, 31 Jul 2022 13:13:28 +0100	[thread overview]
Message-ID: <20220731131328.7301de32@jic23-huawei> (raw)
In-Reply-To: <20220727210253.3794069-28-daniel.lezcano@linexp.org>

On Wed, 27 Jul 2022 23:02:48 +0200
Daniel Lezcano <daniel.lezcano@linexp.org> 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>
Whilst making no pretence at having checked what the new calls do, I'm fine with this
patch affecting the driver in IIO and going through appropriate thermal tree.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  drivers/iio/adc/sun4i-gpadc-iio.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
> index 2d393a4dfff6..13d1e937357c 100644
> --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> @@ -412,9 +412,9 @@ static int sun4i_gpadc_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static int sun4i_gpadc_get_temp(void *data, int *temp)
> +static int sun4i_gpadc_get_temp(struct thermal_zone_device *tz, int *temp)
>  {
> -	struct sun4i_gpadc_iio *info = data;
> +	struct sun4i_gpadc_iio *info = tz->devdata;
>  	int val, scale, offset;
>  
>  	if (sun4i_gpadc_temp_read(info->indio_dev, &val))
> @@ -428,7 +428,7 @@ static int sun4i_gpadc_get_temp(void *data, int *temp)
>  	return 0;
>  }
>  
> -static const struct thermal_zone_of_device_ops sun4i_ts_tz_ops = {
> +static const struct thermal_zone_device_ops sun4i_ts_tz_ops = {
>  	.get_temp = &sun4i_gpadc_get_temp,
>  };
>  
> @@ -637,9 +637,9 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
>  	pm_runtime_enable(&pdev->dev);
>  
>  	if (IS_ENABLED(CONFIG_THERMAL_OF)) {
> -		info->tzd = thermal_zone_of_sensor_register(info->sensor_device,
> -							    0, info,
> -							    &sun4i_ts_tz_ops);
> +		info->tzd = thermal_of_zone_register(info->sensor_device,
> +						     0, info,
> +						     &sun4i_ts_tz_ops);
>  		/*
>  		 * Do not fail driver probing when failing to register in
>  		 * thermal because no thermal DT node is found.


  reply	other threads:[~2022-07-31 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220727210253.3794069-1-daniel.lezcano@linexp.org>
2022-07-27 21:02 ` [PATCH v3 08/32] thermal/drivers/sun8i: Switch to new of API Daniel Lezcano
2022-07-27 21:02 ` [PATCH v3 27/32] iio/drivers/sun4i_gpadc: Switch to new of thermal API Daniel Lezcano
2022-07-31 12:13   ` Jonathan Cameron [this message]
2022-07-31 18:45     ` Daniel Lezcano
2022-07-27 21:02 ` [PATCH v3 28/32] Input: sun4i-ts - switch " Daniel Lezcano

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=20220731131328.7301de32@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=abailon@baylibre.com \
    --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=jernej.skrabec@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=khilman@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --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=samuel@sholland.org \
    --cc=shawnguo@kernel.org \
    --cc=talel@amazon.com \
    --cc=thierry.reding@gmail.com \
    --cc=tiny.windzz@gmail.com \
    --cc=wens@csie.org \
    /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