[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240130111250.185718-12-angelogioacchino.delregno@collabora.com>
Date: Tue, 30 Jan 2024 12:12:43 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: daniel.lezcano@...aro.org
Cc: miquel.raynal@...tlin.com,
rafael@...nel.org,
rui.zhang@...el.com,
lukasz.luba@....com,
support.opensource@...semi.com,
shawnguo@...nel.org,
s.hauer@...gutronix.de,
kernel@...gutronix.de,
festevam@...il.com,
linux-imx@....com,
andersson@...nel.org,
konrad.dybcio@...aro.org,
amitk@...nel.org,
thara.gopinath@...il.com,
niklas.soderlund@...natech.se,
srinivas.pandruvada@...ux.intel.com,
angelogioacchino.delregno@...labora.com,
baolin.wang@...ux.alibaba.com,
u.kleine-koenig@...gutronix.de,
hayashi.kunihiko@...ionext.com,
d-gole@...com,
linus.walleij@...aro.org,
DLG-Adam.Ward.opensource@...renesas.com,
error27@...il.com,
heiko@...ech.de,
hdegoede@...hat.com,
jernej.skrabec@...il.com,
f.fainelli@...il.com,
bchihi@...libre.com,
linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
kernel@...labora.com
Subject: [PATCH v1 11/18] thermal: intel: int340x: Migrate to thermal_zone_device_register()
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.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
---
.../int340x_thermal/int340x_thermal_zone.c | 28 +++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
index 3e4bfe817fac..e45fdd36db55 100644
--- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
+++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
@@ -118,19 +118,17 @@ static int int340x_thermal_read_trips(struct acpi_device *zone_adev,
return trip_cnt;
}
-static struct thermal_zone_params int340x_thermal_params = {
- .governor_name = "user_space",
- .no_hwmon = true,
-};
-
struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
int (*get_temp) (struct thermal_zone_device *, int *))
{
+ struct thermal_governor_params tgp = {
+ .governor_name = "user_space"
+ };
struct int34x_thermal_zone *int34x_zone;
+ struct thermal_zone_device_params tzdp;
struct thermal_trip *zone_trips;
unsigned long long trip_cnt = 0;
unsigned long long hyst;
- int trip_mask = 0;
acpi_status status;
int i, ret;
@@ -153,7 +151,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
status = acpi_evaluate_integer(adev->handle, "PATC", NULL, &trip_cnt);
if (ACPI_SUCCESS(status)) {
int34x_zone->aux_trip_nr = trip_cnt;
- trip_mask = BIT(trip_cnt) - 1;
+ tzdp.tzp.mask = BIT(trip_cnt) - 1;
}
zone_trips = kzalloc(sizeof(*zone_trips) * (trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT),
@@ -183,13 +181,15 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
int34x_zone->lpat_table = acpi_lpat_get_conversion_table(adev->handle);
- int34x_zone->zone = thermal_zone_device_register_with_trips(
- acpi_device_bid(adev),
- zone_trips, trip_cnt,
- trip_mask, int34x_zone,
- int34x_zone->ops,
- &int340x_thermal_params,
- 0, 0);
+ tzdp.tzp.type = acpi_device_bid(adev);
+ tzdp.tzp.ops = int34x_zone->ops;
+ tzdp.tzp.devdata = int34x_zone;
+ tzdp.tzp.trips = zone_trips;
+ tzdp.tzp.num_trips = trip_cnt;
+ tzdp.tzp.no_hwmon = true;
+ tzdp.tgp = &tgp;
+
+ int34x_zone->zone = thermal_zone_device_register(&tzdp);
if (IS_ERR(int34x_zone->zone)) {
ret = PTR_ERR(int34x_zone->zone);
goto err_thermal_zone;
--
2.43.0
Powered by blists - more mailing lists