summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-05 17:10:08 -0600
committerSimon Glass <sjg@chromium.org>2016-07-27 14:14:37 -0600
commitcc7f66f70cc2c59fe8ebf9011658447815278894 (patch)
tree3e37506e9935e3ed54095c93b335d598d7eb0162 /drivers
parent5628347f59e1672f381b8113e85e47529770ab47 (diff)
downloadu-boot-imx-cc7f66f70cc2c59fe8ebf9011658447815278894.zip
u-boot-imx-cc7f66f70cc2c59fe8ebf9011658447815278894.tar.gz
u-boot-imx-cc7f66f70cc2c59fe8ebf9011658447815278894.tar.bz2
dm: core: Add a function to bind child devices
We currently use dm_scan_fdt_node() to bind devices. It is an internal function and it requires the caller to know whether we are pre- or post- relocation. This requirement has become quite common in drivers, so the current function is not ideal. Add a new function with fewer arguments, that does not require internal headers. This can be used directly as a post_bind() method if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/root.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 1587024..33dc9c0 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -218,6 +218,15 @@ int dm_scan_fdt_node(struct udevice *parent, const void *blob, int offset,
return ret;
}
+int dm_scan_fdt_dev(struct udevice *dev)
+{
+ if (dev->of_offset == -1)
+ return 0;
+
+ return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset,
+ gd->flags & GD_FLG_RELOC ? false : true);
+}
+
int dm_scan_fdt(const void *blob, bool pre_reloc_only)
{
return dm_scan_fdt_node(gd->dm_root, blob, 0, pre_reloc_only);