summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/scpi-hwmon.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linexp.org>2022-08-05 00:43:43 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2022-08-17 14:09:39 +0200
commite5181331359d9311b3cc7e09d9d1cb2ffe87f602 (patch)
tree3fb28a779cf3cf8b97b3a3c296da31264cbcf121 /drivers/hwmon/scpi-hwmon.c
parent613ed3f67609291c9b757d62f1f6734e40cb60d8 (diff)
downloadlinux-e5181331359d9311b3cc7e09d9d1cb2ffe87f602.tar.gz
linux-e5181331359d9311b3cc7e09d9d1cb2ffe87f602.tar.bz2
linux-e5181331359d9311b3cc7e09d9d1cb2ffe87f602.zip
hwmon/drivers/core: Switch to new of thermal API
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> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220804224349.1926752-28-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/hwmon/scpi-hwmon.c')
-rw-r--r--drivers/hwmon/scpi-hwmon.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/hwmon/scpi-hwmon.c b/drivers/hwmon/scpi-hwmon.c
index 5187c6dd5a4f..4d75385f7d5e 100644
--- a/drivers/hwmon/scpi-hwmon.c
+++ b/drivers/hwmon/scpi-hwmon.c
@@ -62,9 +62,9 @@ static void scpi_scale_reading(u64 *value, struct sensor_data *sensor)
}
}
-static int scpi_read_temp(void *dev, int *temp)
+static int scpi_read_temp(struct thermal_zone_device *tz, int *temp)
{
- struct scpi_thermal_zone *zone = dev;
+ struct scpi_thermal_zone *zone = tz->devdata;
struct scpi_sensors *scpi_sensors = zone->scpi_sensors;
struct scpi_ops *scpi_ops = scpi_sensors->scpi_ops;
struct sensor_data *sensor = &scpi_sensors->data[zone->sensor_id];
@@ -121,7 +121,7 @@ scpi_show_label(struct device *dev, struct device_attribute *attr, char *buf)
return sprintf(buf, "%s\n", sensor->info.name);
}
-static const struct thermal_zone_of_device_ops scpi_sensor_ops = {
+static const struct thermal_zone_device_ops scpi_sensor_ops = {
.get_temp = scpi_read_temp,
};
@@ -275,10 +275,10 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
zone->sensor_id = i;
zone->scpi_sensors = scpi_sensors;
- z = devm_thermal_zone_of_sensor_register(dev,
- sensor->info.sensor_id,
- zone,
- &scpi_sensor_ops);
+ z = devm_thermal_of_zone_register(dev,
+ sensor->info.sensor_id,
+ zone,
+ &scpi_sensor_ops);
/*
* The call to thermal_zone_of_sensor_register returns
* an error for sensors that are not associated with