thermal/drivers/qoriq: Switch to new of API
authorDaniel Lezcano <daniel.lezcano@linexp.org>
Thu, 4 Aug 2022 22:43:35 +0000 (00:43 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 17 Aug 2022 12:09:38 +0000 (14:09 +0200)
The thermal OF code has a new API allowing to migrate the OF
initialization to a simpler approach. The ops are no longer device
tree specific and are the generic ones provided by the core code.

Convert the ops to the thermal_zone_device_ops format and use the new
API to register the thermal zone with these generic ops.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linexp.org>
Link: https://lore.kernel.org/r/20220804224349.1926752-20-daniel.lezcano@linexp.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/qoriq_thermal.c

index 73049f9bea252dd0cce3ef2a00be6edf3cd4552d..d111e218f362ebbfd85a6d191ea15f82a891643e 100644 (file)
@@ -82,9 +82,9 @@ static struct qoriq_tmu_data *qoriq_sensor_to_data(struct qoriq_sensor *s)
        return container_of(s, struct qoriq_tmu_data, sensor[s->id]);
 }
 
-static int tmu_get_temp(void *p, int *temp)
+static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct qoriq_sensor *qsensor = p;
+       struct qoriq_sensor *qsensor = tz->devdata;
        struct qoriq_tmu_data *qdata = qoriq_sensor_to_data(qsensor);
        u32 val;
        /*
@@ -122,7 +122,7 @@ static int tmu_get_temp(void *p, int *temp)
        return 0;
 }
 
-static const struct thermal_zone_of_device_ops tmu_tz_ops = {
+static const struct thermal_zone_device_ops tmu_tz_ops = {
        .get_temp = tmu_get_temp,
 };
 
@@ -146,9 +146,9 @@ static int qoriq_tmu_register_tmu_zone(struct device *dev,
 
                sensor->id = id;
 
-               tzd = devm_thermal_zone_of_sensor_register(dev, id,
-                                                          sensor,
-                                                          &tmu_tz_ops);
+               tzd = devm_thermal_of_zone_register(dev, id,
+                                                   sensor,
+                                                   &tmu_tz_ops);
                ret = PTR_ERR_OR_ZERO(tzd);
                if (ret) {
                        if (ret == -ENODEV)