Skip to content

Commit

Permalink
Merge tag 'thermal-6.6-rc3' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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()
  • Loading branch information
torvalds committed Sep 22, 2023
2 parents b184c04 + ea31056 commit 8018e02
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/thermal/thermal_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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);
Expand Down

0 comments on commit 8018e02

Please sign in to comment.