aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/leds.h')
-rw-r--r--drivers/leds/leds.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h
index 5edbf52c4fa7..2dd8ecbfdc31 100644
--- a/drivers/leds/leds.h
+++ b/drivers/leds/leds.h
@@ -20,8 +20,8 @@
20static inline void led_set_brightness(struct led_classdev *led_cdev, 20static inline void led_set_brightness(struct led_classdev *led_cdev,
21 enum led_brightness value) 21 enum led_brightness value)
22{ 22{
23 if (value > LED_FULL) 23 if (value > led_cdev->max_brightness)
24 value = LED_FULL; 24 value = led_cdev->max_brightness;
25 led_cdev->brightness = value; 25 led_cdev->brightness = value;
26 if (!(led_cdev->flags & LED_SUSPENDED)) 26 if (!(led_cdev->flags & LED_SUSPENDED))
27 led_cdev->brightness_set(led_cdev, value); 27 led_cdev->brightness_set(led_cdev, value);