summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2020-09-14 11:02:02 -0400
committerTom Rini <trini@konsulko.com>2020-10-08 11:42:36 -0400
commitaaa3645e16fcc164913af20ccb36a1ec77322008 (patch)
tree54c542d4822501e982f6a68e6d551bf6b0707dca
parentb4167aa15ac13cbbd3948463d9d5f97fb98d2709 (diff)
downloadu-boot-aaa3645e16fcc164913af20ccb36a1ec77322008.tar.gz
u-boot-aaa3645e16fcc164913af20ccb36a1ec77322008.tar.xz
u-boot-aaa3645e16fcc164913af20ccb36a1ec77322008.zip
led: gpio: Default to using node name if label is absent
This more closely mirrors Linux's behaviour, and will make it easier to transition to using function+color in the future. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--drivers/led/led_gpio.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c
index ef9b61ee62..2cdb0269f4 100644
--- a/drivers/led/led_gpio.c
+++ b/drivers/led/led_gpio.c
@@ -99,11 +99,8 @@ static int led_gpio_bind(struct udevice *parent)
const char *label;
label = ofnode_read_string(node, "label");
- if (!label) {
- debug("%s: node %s has no label\n", __func__,
- ofnode_get_name(node));
- return -EINVAL;
- }
+ if (!label)
+ label = ofnode_get_name(node);
ret = device_bind_driver_to_node(parent, "gpio_led",
ofnode_get_name(node),
node, &dev);