diff options
author | Marek Vasut <marex@denx.de> | 2022-04-22 15:15:55 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-28 09:26:43 -0400 |
commit | e3aa76644c2af14631a1fb5ba17022e0a396a6c4 (patch) | |
tree | 9629063d9896b3081b11fcc1551bf852afa90387 /drivers/led | |
parent | c438866b16745fc69f0f05636b9cf69b16378fca (diff) | |
download | u-boot-e3aa76644c2af14631a1fb5ba17022e0a396a6c4.zip u-boot-e3aa76644c2af14631a1fb5ba17022e0a396a6c4.tar.gz u-boot-e3aa76644c2af14631a1fb5ba17022e0a396a6c4.tar.bz2 |
led: gpio: Check device compatible string to determine the top level node
Since 2d1deaf88ed ("led: gpio: Drop duplicate OF "label" property parsing"),
all LED nodes have some sort of label. Use device_is_compatible(..."leds-gpio")
to determine whether this is a top-level node, since it is only the top
level node which is compatible with "leds-gpio", the GPIO LEDs subnodes
are not.
Fixes: 2d1deaf88ed ("led: gpio: Drop duplicate OF "label" property parsing")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Steven Lawrance <steven.lawrance@softathome.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Diffstat (limited to 'drivers/led')
-rw-r--r-- | drivers/led/led_gpio.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c index 958dbd3..2315690 100644 --- a/drivers/led/led_gpio.c +++ b/drivers/led/led_gpio.c @@ -57,12 +57,11 @@ static enum led_state_t gpio_led_get_state(struct udevice *dev) static int led_gpio_probe(struct udevice *dev) { - struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev); struct led_gpio_priv *priv = dev_get_priv(dev); int ret; /* Ignore the top-level LED node */ - if (!uc_plat->label) + if (device_is_compatible(dev, "gpio-leds")) return 0; ret = gpio_request_by_name(dev, "gpios", 0, &priv->gpio, GPIOD_IS_OUT); |