diff options
author | Rasmus Villemoes <rasmus.villemoes@prevas.dk> | 2023-11-17 12:38:10 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-12-13 11:35:15 -0500 |
commit | d45e712f880d930bf14be022730d1268d6de0158 (patch) | |
tree | 19d27f770e59e419d889b97f431d14dd9315d4b9 /drivers | |
parent | 82eb8e5171d3b7b9186ec1a490498c29911c5916 (diff) | |
download | u-boot-d45e712f880d930bf14be022730d1268d6de0158.zip u-boot-d45e712f880d930bf14be022730d1268d6de0158.tar.gz u-boot-d45e712f880d930bf14be022730d1268d6de0158.tar.bz2 |
led: led_pwm: use led_bind_generic() helper
Use the helper led_bind_generic() to reduce code duplication.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/led/led_pwm.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/led/led_pwm.c b/drivers/led/led_pwm.c index 7c8eae9..ae6de30 100644 --- a/drivers/led/led_pwm.c +++ b/drivers/led/led_pwm.c @@ -9,7 +9,6 @@ #include <errno.h> #include <led.h> #include <malloc.h> -#include <dm/lists.h> #include <pwm.h> #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 = { |