public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: rafael@kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com
Subject: Re: [RFC PATCH 02/26] thermal/of: Migrate to thermal_zone_device_register()
Date: Mon, 15 Jan 2024 18:17:03 +0100	[thread overview]
Message-ID: <415ca710-1b28-47e5-bffa-3f9f76c59041@linaro.org> (raw)
In-Reply-To: <20231221124825.149141-3-angelogioacchino.delregno@collabora.com>

On 21/12/2023 13:48, AngeloGioacchino Del Regno wrote:
> The thermal API has a new thermal_zone_device_register() function which
> is deprecating the older thermal_zone_device_register_with_trips() and
> thermal_tripless_zone_device_register().
> 
> Migrate to the new thermal zone device registration function.

Sounds good to me.

May be add "No functional change intended" ?

> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com > ---
>   drivers/thermal/thermal_of.c | 37 ++++++++++++++++--------------------
>   1 file changed, 16 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 1e0655b63259..62a903ad649f 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -471,16 +471,12 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
>   							    const struct thermal_zone_device_ops *ops)
>   {
>   	struct thermal_zone_device *tz;
> -	struct thermal_trip *trips;
> -	struct thermal_zone_params tzp = {};
> -	struct thermal_zone_device_ops *of_ops;
> +	struct thermal_zone_device_params tzdp;
>   	struct device_node *np;
> -	int delay, pdelay;
> -	int ntrips, mask;
>   	int ret;
>   
> -	of_ops = kmemdup(ops, sizeof(*ops), GFP_KERNEL);
> -	if (!of_ops)
> +	tzdp.ops = kmemdup(ops, sizeof(*ops), GFP_KERNEL);
> +	if (!tzdp.ops)
>   		return ERR_PTR(-ENOMEM);
>   
>   	np = of_thermal_zone_find(sensor, id);
> @@ -490,30 +486,29 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
>   		ret = PTR_ERR(np);
>   		goto out_kfree_of_ops;
>   	}
> +	tzdp.type = np->name;
>   
> -	trips = thermal_of_trips_init(np, &ntrips);
> -	if (IS_ERR(trips)) {
> +	tzdp.trips = thermal_of_trips_init(np, &tzdp.num_trips);
> +	if (IS_ERR(tzdp.trips)) {
>   		pr_err("Failed to find trip points for %pOFn id=%d\n", sensor, id);
> -		ret = PTR_ERR(trips);
> +		ret = PTR_ERR(tzdp.trips);
>   		goto out_kfree_of_ops;
>   	}
>   
> -	ret = thermal_of_monitor_init(np, &delay, &pdelay);
> +	ret = thermal_of_monitor_init(np, &tzdp.polling_delay, &tzdp.passive_delay);
>   	if (ret) {
>   		pr_err("Failed to initialize monitoring delays from %pOFn\n", np);
>   		goto out_kfree_trips;
>   	}
>   
> -	thermal_of_parameters_init(np, &tzp);
> +	thermal_of_parameters_init(np, &tzdp.tzp);
>   
> -	of_ops->bind = thermal_of_bind;
> -	of_ops->unbind = thermal_of_unbind;
> +	tzdp.ops->bind = thermal_of_bind;
> +	tzdp.ops->unbind = thermal_of_unbind;
> +	tzdp.mask = GENMASK_ULL((tzdp.num_trips) - 1, 0);
> +	tzdp.devdata = data;
>   
> -	mask = GENMASK_ULL((ntrips) - 1, 0);
> -
> -	tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips,
> -						     mask, data, of_ops, &tzp,
> -						     pdelay, delay);
> +	tz = thermal_zone_device_register(&tzdp);
>   	if (IS_ERR(tz)) {
>   		ret = PTR_ERR(tz);
>   		pr_err("Failed to register thermal zone %pOFn: %d\n", np, ret);
> @@ -531,9 +526,9 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
>   	return tz;
>   
>   out_kfree_trips:
> -	kfree(trips);
> +	kfree(tzdp.trips);
>   out_kfree_of_ops:
> -	kfree(of_ops);
> +	kfree(tzdp.ops);
>   
>   	return ERR_PTR(ret);
>   }

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


  reply	other threads:[~2024-01-15 17:17 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 12:47 [RFC PATCH 00/26] Add thermal zones names and new registration func AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 01/26] thermal: Introduce thermal_zone_device_register() and params structure AngeloGioacchino Del Regno
2024-01-15 12:39   ` Daniel Lezcano
2024-01-16  9:58     ` AngeloGioacchino Del Regno
2024-01-18  9:39       ` AngeloGioacchino Del Regno
2024-01-18  9:46         ` AngeloGioacchino Del Regno
2024-01-22 19:19         ` Daniel Lezcano
2024-01-23 10:58           ` AngeloGioacchino Del Regno
2024-01-22 19:19         ` Daniel Lezcano
2023-12-21 12:48 ` [RFC PATCH 02/26] thermal/of: Migrate to thermal_zone_device_register() AngeloGioacchino Del Regno
2024-01-15 17:17   ` Daniel Lezcano [this message]
2024-01-16  9:50     ` AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 03/26] platform/x86: acerhdf: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 04/26] ACPI: thermal: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 05/26] thermal/drivers/da9062: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 06/26] thermal/drivers/imx: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 07/26] thermal/drivers/rcar: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 08/26] thermal/drivers/st: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 09/26] thermal: intel: pch_thermal: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 10/26] thermal: intel: quark_dts: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 11/26] thermal: intel: soc_dts_iosf: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 12/26] thermal: intel: int340x: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 13/26] thermal: int340x: processor: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 14/26] thermal: intel: x86_pkg_temp: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 15/26] power: supply: core: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 16/26] thermal/drivers/armada: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 17/26] thermal/drivers/dove: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 18/26] thermal/drivers/kirkwood: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 19/26] thermal/drivers/spear: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 20/26] thermal/drivers/int340x: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 21/26] wifi: iwlwifi: mvm: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 22/26] cxgb4: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 23/26] mlxsw: core_thermal: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 24/26] fixup! power: supply: core: " AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 25/26] thermal: Remove tripless_zone_register and register_with_trips functions AngeloGioacchino Del Regno
2023-12-21 12:48 ` [RFC PATCH 26/26] thermal: Introduce thermal zones names AngeloGioacchino Del Regno
2024-01-16  9:14   ` Daniel Lezcano
2024-01-16  9:45     ` AngeloGioacchino Del Regno
2024-01-16 11:30       ` Daniel Lezcano
2024-01-16 11:37         ` AngeloGioacchino Del Regno
2023-12-21 13:38 ` [RFC PATCH 00/26] Add thermal zones names and new registration func Rafael J. Wysocki
2023-12-21 13:54   ` AngeloGioacchino Del Regno

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=415ca710-1b28-47e5-bffa-3f9f76c59041@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.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