summaryrefslogtreecommitdiff
path: root/drivers/core/device.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-11-11 10:46:19 -0700
committerSimon Glass <sjg@chromium.org>2014-11-22 10:16:47 +0100
commit479728cb0c752a121e0fd84c6c6d74e93e086905 (patch)
tree845ec0bba9e72511b1d07522f0cdb89d29b3a65b /drivers/core/device.c
parent2ef249b4420818d7ea31a031f48825e5f38ed3ac (diff)
dm: core: Add functions to find parent and OF data
Add dev_get_parent() as a convenience to obtain the parent of a device. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com> Acked-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r--drivers/core/device.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 81ddecade2..6793e1c4f9 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -381,6 +381,11 @@ int device_find_next_child(struct udevice **devp)
return 0;
}
+struct udevice *dev_get_parent(struct udevice *child)
+{
+ return child->parent;
+}
+
ulong dev_get_of_data(struct udevice *dev)
{
return dev->of_id->data;