summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_sysfs.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linexp.org>2022-08-05 00:43:48 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2022-08-17 14:09:39 +0200
commit9326167058e8a5b93179f19fc0368f5324a1f628 (patch)
treea51d4c190f9008822b70548c84a4fb4981a182d4 /drivers/thermal/thermal_sysfs.c
parentthermal/drivers/samsung: Switch to new of thermal API (diff)
downloadlinux-9326167058e8a5b93179f19fc0368f5324a1f628.tar.xz
linux-9326167058e8a5b93179f19fc0368f5324a1f628.zip
thermal/core: Move set_trip_temp ops to the sysfs code
Given the trip points can be set in the thermal zone structure, there is no need of a specific OF function to do that. Move the code in the place where it is generic, in the sysfs set_trip_temp storing function. Signed-off-by: Daniel Lezcano <daniel.lezcano@linexp.org> Link: https://lore.kernel.org/r/20220804224349.1926752-33-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/thermal/thermal_sysfs.c')
-rw-r--r--drivers/thermal/thermal_sysfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 3a8d6e747c25..0f8201060c38 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -115,7 +115,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
int temperature, hyst = 0;
enum thermal_trip_type type;
- if (!tz->ops->set_trip_temp)
+ if (!tz->ops->set_trip_temp && !tz->trips)
return -EPERM;
if (sscanf(attr->attr.name, "trip_point_%d_temp", &trip) != 1)
@@ -128,6 +128,9 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
if (ret)
return ret;
+ if (tz->trips)
+ tz->trips[trip].temperature = temperature;
+
if (tz->ops->get_trip_hyst) {
ret = tz->ops->get_trip_hyst(tz, trip, &hyst);
if (ret)