[RFC PATCH 04/26] ACPI: thermal: Migrate to thermal_zone_device_register()

From: AngeloGioacchino Del Regno
Date: Thu Dec 21 2023 - 07:49:29 EST


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@xxxxxxxxxxxxx>
---
drivers/acpi/thermal.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index ee28ca93d983..e4f44e7bb3ec 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -664,16 +664,18 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz,
unsigned int trip_count,
int passive_delay)
{
+ struct thermal_zone_device_params tzdp = {
+ .type = "acpitz",
+ .devdata = tz,
+ .ops = &acpi_thermal_zone_ops,
+ .trips = tz->trip_table,
+ .num_trips = trip_count,
+ .passive_delay = passive_delay,
+ .polling_delay = tz->polling_frequency * 100,
+ };
int result;

- tz->thermal_zone = thermal_zone_device_register_with_trips("acpitz",
- tz->trip_table,
- trip_count,
- 0, tz,
- &acpi_thermal_zone_ops,
- NULL,
- passive_delay,
- tz->polling_frequency * 100);
+ tz->thermal_zone = thermal_zone_device_register(&tzdp);
if (IS_ERR(tz->thermal_zone))
return PTR_ERR(tz->thermal_zone);

--
2.43.0