From: Daniel Lezcano Date: Mon, 27 Jul 2020 23:10:33 +0000 (+0200) Subject: thermal: core: Add thermal zone enable/disable notification X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=25be77e588a63b064e8d9c1b59975e6882abc2f9;p=linux.git thermal: core: Add thermal zone enable/disable notification Now the calls to enable/disable a thermal zone are centralized in a call to a function, we can add in these the corresponding netlink notifications. Signed-off-by: Daniel Lezcano Acked-by: Zhang Rui Reviewed-by: Amit Kucheria Link: https://lore.kernel.org/r/20200727231033.26512-1-daniel.lezcano@linaro.org --- diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9748fbb9a3a19..72bf159bceccd 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -509,6 +509,11 @@ static int thermal_zone_device_set_mode(struct thermal_zone_device *tz, thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); + if (mode == THERMAL_DEVICE_ENABLED) + thermal_notify_tz_enable(tz->id); + else + thermal_notify_tz_disable(tz->id); + return ret; }