summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2024-09-23 11:59:58 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-10-10 23:33:37 +0200
commit85ee9449f76430846132b0248a99a6cfb524f992 (patch)
treee5ee2741c4a27dc4ea7c911341268d1ea7b07e5e
parent445936f9e258eca624c8239056bd8cd6e853b3fd (diff)
thermal: core: Connect the threshold with the core
Initialize, de-initialize and handle the threshold in the same place than the trip points. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://patch.msgid.link/20240923100005.2532430-3-daniel.lezcano@linaro.org [ rjw: Subject edit ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/thermal/thermal_core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 8f03985f971c..1e87256e86be 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -585,6 +585,8 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,
high = td->threshold;
}
+ thermal_thresholds_handle(tz, &low, &high);
+
thermal_zone_set_trips(tz, low, high);
list_sort(NULL, &way_up_list, thermal_trip_notify_cmp);
@@ -1491,6 +1493,10 @@ thermal_zone_device_register_with_trips(const char *type,
goto unregister;
}
+ result = thermal_thresholds_init(tz);
+ if (result)
+ goto remove_hwmon;
+
mutex_lock(&thermal_list_lock);
mutex_lock(&tz->lock);
@@ -1514,6 +1520,8 @@ thermal_zone_device_register_with_trips(const char *type,
return tz;
+remove_hwmon:
+ thermal_remove_hwmon_sysfs(tz);
unregister:
device_del(&tz->device);
release_device:
@@ -1601,6 +1609,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
thermal_set_governor(tz, NULL);
+ thermal_thresholds_exit(tz);
thermal_remove_hwmon_sysfs(tz);
ida_free(&thermal_tz_ida, tz->id);
ida_destroy(&tz->ida);