]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
led: core: Fix brightness setting when setting delay_off=0
authorMatthieu CASTET <matthieu.castet@parrot.com>
Tue, 12 Dec 2017 10:10:44 +0000 (11:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Mar 2018 09:19:43 +0000 (10:19 +0100)
[ Upstream commit 2b83ff96f51d0b039c4561b9f95c824d7bddb85c ]

With the current code, the following sequence won't work :
echo timer > trigger

echo 0 >  delay_off
* at this point we call
** led_delay_off_store
** led_blink_set

drivers/leds/led-core.c

index c1c3af089634cded4f27fd8e6397a9519025ad70..92b6798ef5b3864bef1607158dcdb13566336deb 100644 (file)
@@ -149,7 +149,7 @@ void led_blink_set(struct led_classdev *led_cdev,
                   unsigned long *delay_on,
                   unsigned long *delay_off)
 {
-       del_timer_sync(&led_cdev->blink_timer);
+       led_stop_software_blink(led_cdev);
 
        led_cdev->flags &= ~LED_BLINK_ONESHOT;
        led_cdev->flags &= ~LED_BLINK_ONESHOT_STOP;