Commit 107280e1 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5508466.Sb9uPGUboI@rjwysocki.net
parent afd84fb1
...@@ -258,11 +258,11 @@ const char *thermal_trip_type_name(enum thermal_trip_type trip_type); ...@@ -258,11 +258,11 @@ const char *thermal_trip_type_name(enum thermal_trip_type trip_type);
void thermal_zone_set_trips(struct thermal_zone_device *tz); void thermal_zone_set_trips(struct thermal_zone_device *tz);
int thermal_zone_trip_id(const struct thermal_zone_device *tz, int thermal_zone_trip_id(const struct thermal_zone_device *tz,
const struct thermal_trip *trip); 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); int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
void thermal_zone_trip_down(struct thermal_zone_device *tz, void thermal_zone_trip_down(struct thermal_zone_device *tz,
const struct thermal_trip *trip); 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 */ /* sysfs I/F */
int thermal_zone_create_device_groups(struct thermal_zone_device *tz); int thermal_zone_create_device_groups(struct thermal_zone_device *tz);
......
...@@ -153,9 +153,9 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr, ...@@ -153,9 +153,9 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
mutex_lock(&tz->lock); mutex_lock(&tz->lock);
if (hyst != trip->hysteresis) { 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); mutex_unlock(&tz->lock);
......
...@@ -118,11 +118,11 @@ int thermal_zone_trip_id(const struct thermal_zone_device *tz, ...@@ -118,11 +118,11 @@ int thermal_zone_trip_id(const struct thermal_zone_device *tz,
return trip_to_trip_desc(trip) - tz->trips; return trip_to_trip_desc(trip) - tz->trips;
} }
void thermal_zone_trip_updated(struct thermal_zone_device *tz, void thermal_zone_set_trip_hyst(struct thermal_zone_device *tz,
const struct thermal_trip *trip) struct thermal_trip *trip, int hyst)
{ {
WRITE_ONCE(trip->hysteresis, hyst);
thermal_notify_tz_trip_change(tz, trip); 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, void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment