summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-09-22 13:25:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-09-22 13:25:13 -0700
commit8018e02a87031a5e8afcbd9d35133edd520076bb (patch)
treeeb808dd7ed81a67209525447a8fce81023923df4
parentb184c040dc393296301ee2fa522f44ad61237d68 (diff)
parentea3105672c68a5b6d7368504067220682ee6c65c (diff)
downloadlwn-8018e02a87031a5e8afcbd9d35133edd520076bb.tar.gz
lwn-8018e02a87031a5e8afcbd9d35133edd520076bb.zip
Merge tag 'thermal-6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fix from Rafael Wysocki: "Unbreak the trip point update sysfs interface that has been broken since the 6.3 cycle (Rafael Wysocki)" * tag 'thermal-6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: sysfs: Fix trip_point_hyst_store()
-rw-r--r--drivers/thermal/thermal_sysfs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 6c20c9f90a05..4e6a97db894e 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -185,9 +185,6 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
if (sscanf(attr->attr.name, "trip_point_%d_hyst", &trip_id) != 1)
return -EINVAL;
- if (kstrtoint(buf, 10, &trip.hysteresis))
- return -EINVAL;
-
mutex_lock(&tz->lock);
if (!device_is_registered(dev)) {
@@ -198,7 +195,11 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
ret = __thermal_zone_get_trip(tz, trip_id, &trip);
if (ret)
goto unlock;
-
+
+ ret = kstrtoint(buf, 10, &trip.hysteresis);
+ if (ret)
+ goto unlock;
+
ret = thermal_zone_set_trip(tz, trip_id, &trip);
unlock:
mutex_unlock(&tz->lock);