Skip to content

Commit 107280e

Browse files
committed
thermal: sysfs: Refine the handling of trip hysteresis changes
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 <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent afd84fb commit 107280e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

drivers/thermal/thermal_core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ const char *thermal_trip_type_name(enum thermal_trip_type trip_type);
258258
void thermal_zone_set_trips(struct thermal_zone_device *tz);
259259
int thermal_zone_trip_id(const struct thermal_zone_device *tz,
260260
const struct thermal_trip *trip);
261-
void thermal_zone_trip_updated(struct thermal_zone_device *tz,
262-
const struct thermal_trip *trip);
263261
int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
264262
void thermal_zone_trip_down(struct thermal_zone_device *tz,
265263
const struct thermal_trip *trip);
264+
void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz,
265+
struct thermal_trip *trip, int hyst);
266266

267267
/* sysfs I/F */
268268
int thermal_zone_create_device_groups(struct thermal_zone_device *tz);

drivers/thermal/thermal_sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
153153
mutex_lock(&tz->lock);
154154

155155
if (hyst != trip->hysteresis) {
156-
WRITE_ONCE(trip->hysteresis, hyst);
156+
thermal_zone_set_trip_hyst(tz, trip, hyst);
157157

158-
thermal_zone_trip_updated(tz, trip);
158+
__thermal_zone_device_update(tz, THERMAL_TRIP_CHANGED);
159159
}
160160

161161
mutex_unlock(&tz->lock);

drivers/thermal/thermal_trip.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ int thermal_zone_trip_id(const struct thermal_zone_device *tz,
118118
return trip_to_trip_desc(trip) - tz->trips;
119119
}
120120

121-
void thermal_zone_trip_updated(struct thermal_zone_device *tz,
122-
const struct thermal_trip *trip)
121+
void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz,
122+
struct thermal_trip *trip, int hyst)
123123
{
124+
WRITE_ONCE(trip->hysteresis, hyst);
124125
thermal_notify_tz_trip_change(tz, trip);
125-
__thermal_zone_device_update(tz, THERMAL_TRIP_CHANGED);
126126
}
127127

128128
void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,

0 commit comments

Comments
 (0)