From: Rasmus Villemoes Date: Fri, 17 Nov 2023 11:38:10 +0000 (+0100) Subject: led: led_pwm: use led_bind_generic() helper X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=d45e712f880d930bf14be022730d1268d6de0158;p=u-boot.git led: led_pwm: 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_pwm.c b/drivers/led/led_pwm.c index 7c8eae9337..ae6de3087a 100644 --- a/drivers/led/led_pwm.c +++ b/drivers/led/led_pwm.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #define LEDS_PWM_DRIVER_NAME "led_pwm" @@ -136,18 +135,7 @@ static int led_pwm_of_to_plat(struct udevice *dev) static int led_pwm_bind(struct udevice *parent) { - struct udevice *dev; - ofnode node; - int ret; - - dev_for_each_subnode(node, parent) { - ret = device_bind_driver_to_node(parent, LEDS_PWM_DRIVER_NAME, - ofnode_get_name(node), - node, &dev); - if (ret) - return ret; - } - return 0; + return led_bind_generic(parent, LEDS_PWM_DRIVER_NAME); } static const struct led_ops led_pwm_ops = {