]> git.baikalelectronics.ru Git - kernel.git/commit
leds: core: avoid error message when a USB LED device is unplugged
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 22 Jan 2016 20:43:48 +0000 (21:43 +0100)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Mon, 14 Mar 2016 08:22:20 +0000 (09:22 +0100)
commitb94d03bca25980240647df9ca541f9ba2727b675
tree6a856df3aff0c9611a666faca10079960a1480f2
parenta427600ad609c826894689e2a70f371e08700fed
leds: core: avoid error message when a USB LED device is unplugged

When a USB LED device is unplugged the remove call chain calls
led_classdev_unregister which tries to switch the LED off.
As the device has been removed already this results in a ENODEV
error message in dmesg.
Avoid this error message by ignoring ENODEV in calls from
led_classdev_unregister if the LED device is flagged as pluggable.

Therefore a new flag LED_HW_PLUGGABLE was introduced which should be set by
all LED drivers handling pluggable LED devices (mainly USB LED devices).

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
drivers/leds/led-class.c
drivers/leds/led-core.c
include/linux/leds.h