summaryrefslogtreecommitdiff
path: root/drivers/led
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/led')
-rw-r--r--drivers/led/led_bcm6328.c2
-rw-r--r--drivers/led/led_bcm6358.c2
-rw-r--r--drivers/led/led_gpio.c13
3 files changed, 7 insertions, 10 deletions
diff --git a/drivers/led/led_bcm6328.c b/drivers/led/led_bcm6328.c
index fa7c6d16d5..5d545c5096 100644
--- a/drivers/led/led_bcm6328.c
+++ b/drivers/led/led_bcm6328.c
@@ -236,7 +236,7 @@ static int bcm6328_led_bind(struct udevice *parent)
ret = device_bind_driver_to_node(parent, "bcm6328-led",
fdt_get_name(blob, node, NULL),
- node, &dev);
+ offset_to_ofnode(node), &dev);
if (ret)
return ret;
diff --git a/drivers/led/led_bcm6358.c b/drivers/led/led_bcm6358.c
index a9a194b0e1..e8a3b64e68 100644
--- a/drivers/led/led_bcm6358.c
+++ b/drivers/led/led_bcm6358.c
@@ -201,7 +201,7 @@ static int bcm6358_led_bind(struct udevice *parent)
ret = device_bind_driver_to_node(parent, "bcm6358-led",
fdt_get_name(blob, node, NULL),
- node, &dev);
+ offset_to_ofnode(node), &dev);
if (ret)
return ret;
diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c
index 4106ecb679..9976635887 100644
--- a/drivers/led/led_gpio.c
+++ b/drivers/led/led_gpio.c
@@ -85,25 +85,22 @@ static int led_gpio_remove(struct udevice *dev)
static int led_gpio_bind(struct udevice *parent)
{
- const void *blob = gd->fdt_blob;
struct udevice *dev;
- int node;
+ ofnode node;
int ret;
- for (node = fdt_first_subnode(blob, dev_of_offset(parent));
- node > 0;
- node = fdt_next_subnode(blob, node)) {
+ dev_for_each_subnode(node, parent) {
struct led_uc_plat *uc_plat;
const char *label;
- label = fdt_getprop(blob, node, "label", NULL);
+ label = ofnode_read_string(node, "label");
if (!label) {
debug("%s: node %s has no label\n", __func__,
- fdt_get_name(blob, node, NULL));
+ ofnode_get_name(node));
return -EINVAL;
}
ret = device_bind_driver_to_node(parent, "gpio_led",
- fdt_get_name(blob, node, NULL),
+ ofnode_get_name(node),
node, &dev);
if (ret)
return ret;