Skip to content

Commit c1beda1

Browse files
committed
thermal: gov_user_space: Use .trip_crossed() instead of .throttle()
Notifying user space about trip points that have not been crossed is not particularly useful, so modify the User Space governor to use the .trip_crossed() callback, which is only invoked for trips that have been crossed, instead of .throttle() that is invoked for all trips in a thermal zone every time the zone is updated. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
1 parent c98e247 commit c1beda1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/thermal/gov_user_space.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ static int user_space_bind(struct thermal_zone_device *tz)
2626
* notify_user_space - Notifies user space about thermal events
2727
* @tz: thermal_zone_device
2828
* @trip: trip point
29+
* @crossed_up: whether or not the trip has been crossed on the way up
2930
*
3031
* This function notifies the user space through UEvents.
3132
*/
32-
static int notify_user_space(struct thermal_zone_device *tz,
33-
const struct thermal_trip *trip)
33+
static void notify_user_space(struct thermal_zone_device *tz,
34+
const struct thermal_trip *trip,
35+
bool crossed_up)
3436
{
3537
char *thermal_prop[5];
3638
int i;
@@ -46,13 +48,11 @@ static int notify_user_space(struct thermal_zone_device *tz,
4648
kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop);
4749
for (i = 0; i < 4; ++i)
4850
kfree(thermal_prop[i]);
49-
50-
return 0;
5151
}
5252

5353
static struct thermal_governor thermal_gov_user_space = {
5454
.name = "user_space",
55-
.throttle = notify_user_space,
55+
.trip_crossed = notify_user_space,
5656
.bind_to_tz = user_space_bind,
5757
};
5858
THERMAL_GOVERNOR_DECLARE(thermal_gov_user_space);

0 commit comments

Comments
 (0)