From: Rasmus Villemoes Date: Fri, 17 Nov 2023 11:38:09 +0000 (+0100) Subject: led: led_gpio: use led_bind_generic() helper X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=82eb8e5171d3b7b9186ec1a490498c29911c5916;p=u-boot.git led: led_gpio: use led_bind_generic() helper Use the helper led_bind_generic() to reduce code duplication. Signed-off-by: Rasmus Villemoes Reviewed-by: Christian Gmeiner --- diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c index fbed151b5d..71421de628 100644 --- a/drivers/led/led_gpio.c +++ b/drivers/led/led_gpio.c @@ -11,7 +11,6 @@ #include #include #include -#include struct led_gpio_priv { struct gpio_desc gpio; @@ -80,19 +79,7 @@ static int led_gpio_remove(struct udevice *dev) static int led_gpio_bind(struct udevice *parent) { - struct udevice *dev; - ofnode node; - int ret; - - dev_for_each_subnode(node, parent) { - ret = device_bind_driver_to_node(parent, "gpio_led", - ofnode_get_name(node), - node, &dev); - if (ret) - return ret; - } - - return 0; + return led_bind_generic(parent, "gpio_led"); } static const struct led_ops gpio_led_ops = {