提交 2b7f1b8c 编写于 作者: R Raphael Assenat 提交者: Richard Purdie

leds: Fix led-gpio active_low default brightness

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: NRaphael Assenat <raph@8d.com>
Signed-off-by: NRichard Purdie <rpurdie@rpsys.net>
上级 92e015cb
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册