[PATCH] led: trig: timer: stop offloading on deactivation
From: Daniel Golle
Date: Fri Jul 28 2023 - 08:31:32 EST
Stop hardware blinking when switching from 'timer' to another trigger.
Fixes: 5ada28bf7675 ("led-class: always implement blinking")
Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>
---
drivers/leds/trigger/ledtrig-timer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/leds/trigger/ledtrig-timer.c b/drivers/leds/trigger/ledtrig-timer.c
index b4688d1d9d2b2..fb6b207b052b8 100644
--- a/drivers/leds/trigger/ledtrig-timer.c
+++ b/drivers/leds/trigger/ledtrig-timer.c
@@ -125,6 +125,8 @@ static void timer_trig_deactivate(struct led_classdev *led_cdev)
{
/* Stop blinking */
led_set_brightness(led_cdev, LED_OFF);
+ if (led_cdev->blink_set)
+ led_cdev->blink_set(led_cdev, 0, 0);
}
static struct led_trigger timer_led_trigger = {
--
2.41.0