mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-22 14:21:29 +02:00
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>
This commit is contained in:
parent
82eb8e5171
commit
d45e712f88
@ -9,7 +9,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <led.h>
|
#include <led.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <dm/lists.h>
|
|
||||||
#include <pwm.h>
|
#include <pwm.h>
|
||||||
|
|
||||||
#define LEDS_PWM_DRIVER_NAME "led_pwm"
|
#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)
|
static int led_pwm_bind(struct udevice *parent)
|
||||||
{
|
{
|
||||||
struct udevice *dev;
|
return led_bind_generic(parent, LEDS_PWM_DRIVER_NAME);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct led_ops led_pwm_ops = {
|
static const struct led_ops led_pwm_ops = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user