mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
leds: core: Flush scheduled work for system suspend
[ Upstream commit302a085c20
] 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:81fe8e5b73
("leds: core: Add led_set_brightness_nosleep{nopm} functions") Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
adbb26e2d4
commit
d25c812320
1 changed files with 1 additions and 0 deletions
|
@ -172,6 +172,7 @@ void led_classdev_suspend(struct led_classdev *led_cdev)
|
|||
{
|
||||
led_cdev->flags |= LED_SUSPENDED;
|
||||
led_set_brightness_nopm(led_cdev, 0);
|
||||
flush_work(&led_cdev->set_brightness_work);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(led_classdev_suspend);
|
||||
|
||||
|
|
Loading…
Reference in a new issue