summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-13 23:41:49 -0600
committerSimon Glass <sjg@chromium.org>2014-10-22 10:36:45 -0600
commita8981d4f80b010666ad754d20a4f389f94d6726d (patch)
tree48bf392bb2e0f00248ac4949fdceefa4b7509cb6 /include
parent0b304a2494eed170562a9fdd64e31332ad5ae73a (diff)
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')
-rw-r--r--include/dm/device.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index e08d496e6a..160cd5883a 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