Skip to content
Snippets Groups Projects
Commit 479728cb authored by Simon Glass's avatar Simon Glass
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarTom Rini <trini@ti.com>
Acked-by: default avatarHeiko Schocher <hs@denx.de>
parent 2ef249b4
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -207,6 +207,14 @@ void *dev_get_parentdata(struct udevice *dev);
*/
void *dev_get_priv(struct udevice *dev);
/**
* struct dev_get_parent() - Get the parent of a device
*
* @child: Child to check
* @return parent of child, or NULL if this is the root device
*/
struct udevice *dev_get_parent(struct udevice *child);
/**
* dev_get_of_data() - get the device tree data used to bind a device
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment