From: Liviu Dudau Date: Thu, 18 Oct 2018 00:14:32 +0000 (+0100) Subject: leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds X-Git-Tag: v5.15~7717^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72b8ad40e14302f869382656a914bb803796b4ed;p=platform%2Fkernel%2Flinux-starfive.git leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds Commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device") removed the common code path that set the led_dat->gpiod pointer in create_gpio_led(), but only added it back for the devices that have a valid gpio_led_platform_data structure. Calling gpio_leds_create() in gpio_led_probe() is not enough to get a valid gpiod pointer. Fortunately enough, gpio_leds_create() already gets the needed pointer, we just need to assign it to the relevant gpio_led_data structure. Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device") Signed-off-by: Liviu Dudau Reviewed-by: Linus Walleij Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski --- diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 32fa752..45e0120 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -163,6 +163,8 @@ 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", &led.default_trigger);