mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 20:04:46 +00:00
led: gpio: Check device compatible string to determine the top level node
Since2d1deaf88e
("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:2d1deaf88e
("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>
This commit is contained in:
parent
c438866b16
commit
e3aa76644c
1 changed files with 1 additions and 2 deletions
|
@ -57,12 +57,11 @@ static enum led_state_t gpio_led_get_state(struct udevice *dev)
|
||||||
|
|
||||||
static int led_gpio_probe(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);
|
struct led_gpio_priv *priv = dev_get_priv(dev);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Ignore the top-level LED node */
|
/* Ignore the top-level LED node */
|
||||||
if (!uc_plat->label)
|
if (device_is_compatible(dev, "gpio-leds"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ret = gpio_request_by_name(dev, "gpios", 0, &priv->gpio, GPIOD_IS_OUT);
|
ret = gpio_request_by_name(dev, "gpios", 0, &priv->gpio, GPIOD_IS_OUT);
|
||||||
|
|
Loading…
Add table
Reference in a new issue