summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-05-19 02:09:07 (GMT)
committerSimon Glass <sjg@chromium.org>2017-06-01 13:03:08 (GMT)
commit45a26867e8158d0338ba5b99d21989a72d423209 (patch)
tree76f30778dcb4a8d50eeea20e2bc68d2ab731c41c /drivers/pinctrl
parentf5b5719cdf13f3ee1ae949a3bcffafb6431eead4 (diff)
downloadu-boot-fsl-qoriq-45a26867e8158d0338ba5b99d21989a72d423209.tar.xz
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/pinctrl')
-rw-r--r--drivers/pinctrl/pinctrl-uclass.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index 0633b69..02e2690 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -121,34 +121,31 @@ static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
*/
static int pinconfig_post_bind(struct udevice *dev)
{
- const void *fdt = gd->fdt_blob;
- int offset = dev_of_offset(dev);
bool pre_reloc_only = !(gd->flags & GD_FLG_RELOC);
const char *name;
+ ofnode node;
int ret;
- for (offset = fdt_first_subnode(fdt, offset);
- offset > 0;
- offset = fdt_next_subnode(fdt, offset)) {
+ dev_for_each_subnode(node, dev) {
if (pre_reloc_only &&
- !dm_fdt_pre_reloc(fdt, offset))
+ !ofnode_pre_reloc(node))
continue;
/*
* If this node has "compatible" property, this is not
* a pin configuration node, but a normal device. skip.
*/
- fdt_get_property(fdt, offset, "compatible", &ret);
+ ofnode_read_prop(node, "compatible", &ret);
if (ret >= 0)
continue;
if (ret != -FDT_ERR_NOTFOUND)
return ret;
- name = fdt_get_name(fdt, offset, NULL);
+ name = ofnode_get_name(node);
if (!name)
return -EINVAL;
ret = device_bind_driver_to_node(dev, "pinconfig", name,
- offset, NULL);
+ node, NULL);
if (ret)
return ret;
}