summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-01 21:22:07 +0300
committerSimon Glass <sjg@chromium.org>2018-10-09 13:40:27 +0300
commitcdb6aa0afb52da34306c4339f2f4d6cbd3b0ad02 (patch)
tree4940b03e27947c496c460da6df96d719fe29dedc /include/dm
parent9f15cc14bf88a9ee8d7b1fbf607cde22923889d6 (diff)
downloadu-boot-cdb6aa0afb52da34306c4339f2f4d6cbd3b0ad02.tar.xz
dm: core: Add a function to find the first inactive child
Some devices have children and want to press an existing inactive child into service when needed. Add a function to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index f873fc66e1..847934425b 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -520,6 +520,21 @@ int device_find_first_child(struct udevice *parent, struct udevice **devp);
int device_find_next_child(struct udevice **devp);
/**
+ * device_find_first_inactive_child() - Find the first inactive child
+ *
+ * This is used to locate an existing child of a device which is of a given
+ * uclass.
+ *
+ * @parent: Parent device to search
+ * @uclass_id: Uclass to look for
+ * @devp: Returns device found, if any
+ * @return 0 if found, else -ENODEV
+ */
+int device_find_first_inactive_child(struct udevice *parent,
+ enum uclass_id uclass_id,
+ struct udevice **devp);
+
+/**
* device_has_children() - check if a device has any children
*
* @dev: Device to check