Skip to content

Commit 8018e02

Browse files
committed
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()
2 parents b184c04 + ea31056 commit 8018e02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/thermal/thermal_sysfs.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
185185
if (sscanf(attr->attr.name, "trip_point_%d_hyst", &trip_id) != 1)
186186
return -EINVAL;
187187

188-
if (kstrtoint(buf, 10, &trip.hysteresis))
189-
return -EINVAL;
190-
191188
mutex_lock(&tz->lock);
192189

193190
if (!device_is_registered(dev)) {
@@ -198,7 +195,11 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
198195
ret = __thermal_zone_get_trip(tz, trip_id, &trip);
199196
if (ret)
200197
goto unlock;
201-
198+
199+
ret = kstrtoint(buf, 10, &trip.hysteresis);
200+
if (ret)
201+
goto unlock;
202+
202203
ret = thermal_zone_set_trip(tz, trip_id, &trip);
203204
unlock:
204205
mutex_unlock(&tz->lock);

0 commit comments

Comments
 (0)