diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/led-class.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index d946991091fb..14139c337312 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -245,12 +245,13 @@ void led_classdev_unregister(struct led_classdev *led_cdev) up_write(&led_cdev->trigger_lock); #endif - cancel_work_sync(&led_cdev->set_brightness_work); - /* Stop blinking */ led_stop_software_blink(led_cdev); + led_set_brightness(led_cdev, LED_OFF); + flush_work(&led_cdev->set_brightness_work); + device_unregister(led_cdev->dev); down_write(&leds_list_lock); |