summaryrefslogtreecommitdiff
path: root/include/linux/leds.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-01-22 21:43:48 +0100
committerJacek Anaszewski <j.anaszewski@samsung.com>2016-03-14 09:22:20 +0100
commitd84d80f38f0ff4eb4becf1a3569c8e7b2c463b61 (patch)
tree6a856df3aff0c9611a666faca10079960a1480f2 /include/linux/leds.h
parent70b2563b35b3edcf67819b99e560f3f0f6ce4a9f (diff)
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>
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r--include/linux/leds.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index e3470e732ede..f203a8f89d30 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -39,6 +39,7 @@ struct led_classdev {
/* Lower 16 bits reflect status */
#define LED_SUSPENDED (1 << 0)
+#define LED_UNREGISTERING (1 << 1)
/* Upper 16 bits reflect control information */
#define LED_CORE_SUSPENDRESUME (1 << 16)
#define LED_BLINK_ONESHOT (1 << 17)
@@ -48,6 +49,7 @@ struct led_classdev {
#define LED_BLINK_DISABLE (1 << 21)
#define LED_SYSFS_DISABLE (1 << 22)
#define LED_DEV_CAP_FLASH (1 << 23)
+#define LED_HW_PLUGGABLE (1 << 24)
/* Set LED brightness level
* Must not sleep. Use brightness_set_blocking for drivers