]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
thermal: sysfs: Refine the handling of trip hysteresis changes
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 29 Jul 2024 16:27:25 +0000 (18:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:38:53 +0000 (16:38 +0200)
[ Upstream commit 107280e1371f1ba183be1ac88e91ec60cad33c18 ]

Change trip_point_hyst_store() and replace thermal_zone_trip_updated()
with thermal_zone_set_trip_hyst() to follow the trip_point_temp_store()
code pattern for more consistency.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5508466.Sb9uPGUboI@rjwysocki.net
Stable-dep-of: 874b6476fa88 ("thermal: sysfs: Add sanity checks for trip temperature and hysteresis")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/thermal_core.h
drivers/thermal/thermal_sysfs.c
drivers/thermal/thermal_trip.c

index 5be8bef41b92606e97fbb05766f5b8f32cfc06b6..3c8e2bca87f2d975dc5f431c84327e60b3466404 100644 (file)
@@ -263,11 +263,11 @@ const char *thermal_trip_type_name(enum thermal_trip_type trip_type);
 void thermal_zone_set_trips(struct thermal_zone_device *tz);
 int thermal_zone_trip_id(const struct thermal_zone_device *tz,
                         const struct thermal_trip *trip);
-void thermal_zone_trip_updated(struct thermal_zone_device *tz,
-                              const struct thermal_trip *trip);
 int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
 void thermal_zone_trip_down(struct thermal_zone_device *tz,
                            const struct thermal_trip *trip);
+void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz,
+                               struct thermal_trip *trip, int hyst);
 
 /* sysfs I/F */
 int thermal_zone_create_device_groups(struct thermal_zone_device *tz);
index 11a34b9fe153db08e9ddd479ff7abf16bb615df4..2709455486776c2f70057e5a0a8c7df61f9d77c6 100644 (file)
@@ -153,9 +153,9 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
        mutex_lock(&tz->lock);
 
        if (hyst != trip->hysteresis) {
-               WRITE_ONCE(trip->hysteresis, hyst);
+               thermal_zone_set_trip_hyst(tz, trip, hyst);
 
-               thermal_zone_trip_updated(tz, trip);
+               __thermal_zone_device_update(tz, THERMAL_TRIP_CHANGED);
        }
 
        mutex_unlock(&tz->lock);
index 06a0554ddc389156ccd51bbbc988bebaa47c0046..fa5ac9b512312d82db59ffa77b2f6af428da1d02 100644 (file)
@@ -138,11 +138,11 @@ int thermal_zone_trip_id(const struct thermal_zone_device *tz,
        return trip_to_trip_desc(trip) - tz->trips;
 }
 
-void thermal_zone_trip_updated(struct thermal_zone_device *tz,
-                              const struct thermal_trip *trip)
+void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz,
+                               struct thermal_trip *trip, int hyst)
 {
+       WRITE_ONCE(trip->hysteresis, hyst);
        thermal_notify_tz_trip_change(tz, trip);
-       __thermal_zone_device_update(tz, THERMAL_TRIP_CHANGED);
 }
 
 void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,