From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
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: Tue, 16 Jan 2024 10:50:30 +0100 [thread overview]
Message-ID: <3b3fdb3b-a22e-499d-89a6-ee06e5f91ee1@collabora.com> (raw)
In-Reply-To: <415ca710-1b28-47e5-bffa-3f9f76c59041@linaro.org>
Il 15/01/24 18:17, Daniel Lezcano ha scritto:
> 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" ?
>
Yeah, makes sense - will add "This patch brings no functional changes".
Cheers!
>> 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);
>> }
>
next prev parent reply other threads:[~2024-01-16 9:50 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
2024-01-16 9:50 ` AngeloGioacchino Del Regno [this message]
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=3b3fdb3b-a22e-499d-89a6-ee06e5f91ee1@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=daniel.lezcano@linaro.org \
--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