Commit 68a306cc authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Daniel Lezcano

thermal/drivers/hisi: Use generic thermal_zone_get_trip() function

The thermal framework gives the possibility to register the trip
points with the thermal zone. When that is done, no get_trip_* ops are
needed and they can be removed.

Convert ops content logic into generic trip points and register them with the
thermal zone.
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20221003092602.1323944-13-daniel.lezcano@linaro.org
parent c7ed8cab
...@@ -482,7 +482,7 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev, ...@@ -482,7 +482,7 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev,
struct hisi_thermal_sensor *sensor) struct hisi_thermal_sensor *sensor)
{ {
int ret, i; int ret, i;
const struct thermal_trip *trip; struct thermal_trip trip;
sensor->tzd = devm_thermal_of_zone_register(&pdev->dev, sensor->tzd = devm_thermal_of_zone_register(&pdev->dev,
sensor->id, sensor, sensor->id, sensor,
...@@ -495,11 +495,12 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev, ...@@ -495,11 +495,12 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev,
return ret; return ret;
} }
trip = of_thermal_get_trip_points(sensor->tzd); for (i = 0; i < thermal_zone_get_num_trips(sensor->tzd); i++) {
for (i = 0; i < of_thermal_get_ntrips(sensor->tzd); i++) { thermal_zone_get_trip(sensor->tzd, i, &trip);
if (trip[i].type == THERMAL_TRIP_PASSIVE) {
sensor->thres_temp = trip[i].temperature; if (trip.type == THERMAL_TRIP_PASSIVE) {
sensor->thres_temp = trip.temperature;
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment