Skip to content

Commit

Permalink
leds: Fix led-gpio active_low default brightness
Browse files Browse the repository at this point in the history
When gpio_direction_output() is called, led_dat->active_low is used
as default value. This means that the led will always be off by
default. cdev.brightness should really have been set to LED_OFF
unconditionally to reflect this behavior.

Signed-off-by: Raphael Assenat <raph@8d.com>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
  • Loading branch information
Raphael Assenat authored and Richard Purdie committed Feb 7, 2008
1 parent 92e015c commit 2b7f1b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/leds/leds-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int gpio_led_probe(struct platform_device *pdev)
led_dat->can_sleep = gpio_cansleep(cur_led->gpio);
led_dat->active_low = cur_led->active_low;
led_dat->cdev.brightness_set = gpio_led_set;
led_dat->cdev.brightness = cur_led->active_low ? LED_FULL : LED_OFF;
led_dat->cdev.brightness = LED_OFF;

ret = gpio_request(led_dat->gpio, led_dat->cdev.name);
if (ret < 0)
Expand Down

0 comments on commit 2b7f1b8

Please sign in to comment.