summaryrefslogtreecommitdiff
path: root/drivers/core/device.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-06-11 13:07:15 -0600
committerSimon Glass <sjg@chromium.org>2018-07-09 09:11:00 -0600
commitd677b00cb62a4cf4d4a24468f218581b4f57c2fe (patch)
treebbc0d69b1d74d872bb0b798c36153d6832f5636a /drivers/core/device.c
parentb616cef97aa8562a8c08558505675e255b5347cc (diff)
dm: core: Add a way to bind a device by ofnode
Add a new device_bind_ofnode() function which can bind a device given its ofnode. This allows binding devices more easily with livetree nodes. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r--drivers/core/device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index e048e1a659..d5f5fc31b0 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -230,6 +230,14 @@ int device_bind(struct udevice *parent, const struct driver *drv,
offset_to_ofnode(of_offset), 0, devp);
}
+int device_bind_ofnode(struct udevice *parent, const struct driver *drv,
+ const char *name, void *platdata, ofnode node,
+ struct udevice **devp)
+{
+ return device_bind_common(parent, drv, name, platdata, 0, node, 0,
+ devp);
+}
+
int device_bind_by_name(struct udevice *parent, bool pre_reloc_only,
const struct driver_info *info, struct udevice **devp)
{