From 82eb8e5171d3b7b9186ec1a490498c29911c5916 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 17 Nov 2023 12:38:09 +0100 Subject: [PATCH] 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 --- drivers/led/led_gpio.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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 = { -- 2.39.5