diff options
Diffstat (limited to 'drivers/led/led-uclass.c')
-rw-r--r-- | drivers/led/led-uclass.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c index a80ae93d45..784ac870e2 100644 --- a/drivers/led/led-uclass.c +++ b/drivers/led/led-uclass.c @@ -24,11 +24,12 @@ int led_get_by_label(const char *label, struct udevice **devp) uclass_foreach_dev(dev, uc) { struct led_uclass_plat *uc_plat = dev_get_uclass_platdata(dev); - if (!strcmp(label, uc_plat->label)) + /* Ignore the top-level LED node */ + if (uc_plat->label && !strcmp(label, uc_plat->label)) return uclass_get_device_tail(dev, 0, devp); } - return -ENOENT; + return -ENODEV; } int led_set_on(struct udevice *dev, int on) |