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

Message ID 20231221124825.149141-5-angelogioacchino.delregno@collabora.com
State New
Headers
Series Add thermal zones names and new registration func |

Commit Message

AngeloGioacchino Del Regno Dec. 21, 2023, 12:48 p.m. UTC
  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@collabora.com>
---
 drivers/acpi/thermal.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
  

Patch

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);