diff options
author | Simon Glass <sjg@chromium.org> | 2014-10-13 23:41:49 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-10-22 10:36:45 -0600 |
commit | a8981d4f80b010666ad754d20a4f389f94d6726d (patch) | |
tree | 48bf392bb2e0f00248ac4949fdceefa4b7509cb6 /include/dm/device.h | |
parent | 0b304a2494eed170562a9fdd64e31332ad5ae73a (diff) | |
download | u-boot-imx-a8981d4f80b010666ad754d20a4f389f94d6726d.zip u-boot-imx-a8981d4f80b010666ad754d20a4f389f94d6726d.tar.gz u-boot-imx-a8981d4f80b010666ad754d20a4f389f94d6726d.tar.bz2 |
dm: core: Add functions for iterating through device children
Buses need to iterate through their children in some situations. Add a few
functions to make this easy.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Diffstat (limited to 'include/dm/device.h')
-rw-r--r-- | include/dm/device.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h index e08d496..160cd58 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -280,4 +280,22 @@ int device_find_child_by_of_offset(struct udevice *parent, int of_offset, int device_get_child_by_of_offset(struct udevice *parent, int seq, struct udevice **devp); +/** + * device_find_first_child() - Find the first child of a device + * + * @parent: Parent device to search + * @devp: Returns first child device, or NULL if none + * @return 0 + */ +int device_find_first_child(struct udevice *parent, struct udevice **devp); + +/** + * device_find_first_child() - Find the first child of a device + * + * @devp: Pointer to previous child device on entry. Returns pointer to next + * child device, or NULL if none + * @return 0 + */ +int device_find_next_child(struct udevice **devp); + #endif |