From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Anderson Date: Wed, 24 Jun 2020 06:29:44 -0400 Subject: [PATCH v4 09/12] led: gpio: Default to using node name if label is absent In-Reply-To: <20200624102947.359794-1-seanga2@gmail.com> References: <20200624102947.359794-1-seanga2@gmail.com> Message-ID: <20200624102947.359794-10-seanga2@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Reviewed-by: Simon Glass --- This patch was previously submitted as part of https://patchwork.ozlabs.org/project/uboot/list/?series=161576 (no changes since v1) drivers/led/led_gpio.c | 7 ++----- 1 file 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); -- 2.26.2