[lkml]   [2018]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] leds: gpio: Fix gpiod for DT based devices
commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
failes to set the gpio descriptor for DT based machines. Since the
value being passed in is always 0 the descriptor fails the validation
check but does so silently. This means the driver probes successfully
even though it can't actually control the gpio line. This patch sets
the gpio descriptor in the path taken by DT based devices.

Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
Signed-off-by: Dan Sneddon <>
drivers/leds/leds-gpio.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 32fa752..e0e57c2 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -162,6 +162,7 @@ static struct gpio_leds_priv
*gpio_leds_create(struct platform_device *pdev)
return ERR_CAST(led.gpiod);
+ led_dat->gpiod = led.gpiod;

fwnode_property_read_string(child, "linux,default-trigger",
 \ /
  Last update: 2018-10-25 17:06    [W:0.080 / U:4.480 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site