]> git.baikalelectronics.ru Git - kernel.git/commit
leds: core: Flush scheduled work for system suspend
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Thu, 2 Jul 2020 05:45:00 +0000 (13:45 +0800)
committerPavel Machek <pavel@ucw.cz>
Sun, 12 Jul 2020 08:10:37 +0000 (10:10 +0200)
commitbf49463b7477ad19cc5f0b82826fcbd652865577
treed408d8ae7b85843fc4150f01fa3f68c393dcd61f
parentcdfa670c81c1f9ad07318dbd439d4e23dfd5e75b
leds: core: Flush scheduled work for system suspend

Sometimes LED won't be turned off by LED_CORE_SUSPENDRESUME flag upon
system suspend.

led_set_brightness_nopm() uses schedule_work() to set LED brightness.
However, there's no guarantee that the scheduled work gets executed
because no one flushes the work.

So flush the scheduled work to make sure LED gets turned off.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Fixes: 77fb9aca5049 ("leds: core: Add led_set_brightness_nosleep{nopm} functions")
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/led-class.c