diff options
Diffstat (limited to 'drivers/leds/led-core.c')
-rw-r--r-- | drivers/leds/led-core.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index 71b40d3bf776..aaa8eba9099f 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/led-core.c | |||
@@ -12,10 +12,11 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/leds.h> | ||
15 | #include <linux/list.h> | 16 | #include <linux/list.h> |
16 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/mutex.h> | ||
17 | #include <linux/rwsem.h> | 19 | #include <linux/rwsem.h> |
18 | #include <linux/leds.h> | ||
19 | #include "leds.h" | 20 | #include "leds.h" |
20 | 21 | ||
21 | DECLARE_RWSEM(leds_list_lock); | 22 | DECLARE_RWSEM(leds_list_lock); |
@@ -126,3 +127,19 @@ void led_set_brightness(struct led_classdev *led_cdev, | |||
126 | __led_set_brightness(led_cdev, brightness); | 127 | __led_set_brightness(led_cdev, brightness); |
127 | } | 128 | } |
128 | EXPORT_SYMBOL(led_set_brightness); | 129 | EXPORT_SYMBOL(led_set_brightness); |
130 | |||
131 | int led_update_brightness(struct led_classdev *led_cdev) | ||
132 | { | ||
133 | int ret = 0; | ||
134 | |||
135 | if (led_cdev->brightness_get) { | ||
136 | ret = led_cdev->brightness_get(led_cdev); | ||
137 | if (ret >= 0) { | ||
138 | led_cdev->brightness = ret; | ||
139 | return 0; | ||
140 | } | ||
141 | } | ||
142 | |||
143 | return ret; | ||
144 | } | ||
145 | EXPORT_SYMBOL(led_update_brightness); | ||