diff options
author | Simon Glass <sjg@chromium.org> | 2017-05-18 20:09:07 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-06-01 07:03:08 -0600 |
commit | 45a26867e8158d0338ba5b99d21989a72d423209 (patch) | |
tree | 76f30778dcb4a8d50eeea20e2bc68d2ab731c41c /drivers/led | |
parent | f5b5719cdf13f3ee1ae949a3bcffafb6431eead4 (diff) | |
download | u-boot-45a26867e8158d0338ba5b99d21989a72d423209.tar.gz u-boot-45a26867e8158d0338ba5b99d21989a72d423209.tar.bz2 u-boot-45a26867e8158d0338ba5b99d21989a72d423209.zip |
dm: core: Update device_bind_driver_to_node() to use ofnode
Adjust this function to us an ofnode instead of an offset, so it can be
used with livetree. This involves updating all callers.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/led')
-rw-r--r-- | drivers/led/led_bcm6328.c | 2 | ||||
-rw-r--r-- | drivers/led/led_bcm6358.c | 2 | ||||
-rw-r--r-- | drivers/led/led_gpio.c | 13 |
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; |