diff options
author | Ingo Molnar <mingo@kernel.org> | 2020-03-21 11:23:40 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-03-21 11:24:41 +0300 |
commit | a4654e9bde4ecedb4921e6c8fe2088114bdff1b3 (patch) | |
tree | 1b9970b520d7bc7176cc9460fe67f210be5ea181 /drivers/leds/leds-gpio.c | |
parent | 7add7875a8eb4ffe5eddaf8a11e409c9e1b6e3f3 (diff) | |
parent | e4160b2e4b02377c67f8ecd05786811598f39acd (diff) | |
download | linux-a4654e9bde4ecedb4921e6c8fe2088114bdff1b3.tar.xz |
Merge branch 'x86/kdump' into locking/kcsan, to resolve conflicts
Conflicts:
arch/x86/purgatory/Makefile
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/leds/leds-gpio.c')
-rw-r--r-- | drivers/leds/leds-gpio.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index a5c73f3d5f79..2bf74595610f 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -151,9 +151,14 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) struct gpio_led led = {}; const char *state = NULL; + /* + * Acquire gpiod from DT with uninitialized label, which + * will be updated after LED class device is registered, + * Only then the final LED name is known. + */ led.gpiod = devm_fwnode_get_gpiod_from_child(dev, NULL, child, GPIOD_ASIS, - led.name); + NULL); if (IS_ERR(led.gpiod)) { fwnode_handle_put(child); return ERR_CAST(led.gpiod); @@ -186,6 +191,9 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) fwnode_handle_put(child); return ERR_PTR(ret); } + /* Set gpiod label to match the corresponding LED name. */ + gpiod_set_consumer_name(led_dat->gpiod, + led_dat->cdev.dev->kobj.name); priv->num_leds++; } |