Skip to content

Commit

Permalink
leds: gpio: Fix semantic error
Browse files Browse the repository at this point in the history
The leds-gpio driver mixes up the legacy GPIO flags with the
GPIO descriptor flags and passes a legacy flag to
devm_gpiod_get_index().

Fix this by replacing the flags variable with the strict
descriptor flag.

Fixes: 45d4c6d ("leds: gpio: Try to lookup gpiod from device")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
  • Loading branch information
Linus Walleij authored and Pavel Machek committed Jul 12, 2020
1 parent 302a085 commit c4e9441
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 @@ -220,7 +220,7 @@ static struct gpio_desc *gpio_led_get_gpiod(struct device *dev, int idx,
* device, this will hit the board file, if any and get
* the GPIO from there.
*/
gpiod = devm_gpiod_get_index(dev, NULL, idx, flags);
gpiod = devm_gpiod_get_index(dev, NULL, idx, GPIOD_OUT_LOW);
if (!IS_ERR(gpiod)) {
gpiod_set_consumer_name(gpiod, template->name);
return gpiod;
Expand Down

0 comments on commit c4e9441

Please sign in to comment.