summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2019-09-04 16:01:26 +0530
committerTom Rini <trini@konsulko.com>2019-10-11 10:07:33 -0400
commit240b93201007183d5fd651a210ddb4c50ee30980 (patch)
tree0c26904b4c83bebecc358ac33aa1025ce13f1d0c /include/dm
parentbc74163a46208d1f9af8bfd2d06859b62145ef56 (diff)
dm: core: Add a function to count the children of a device
Add a function to count the available children of a device. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index d1210429e92..defda0aebcb 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -405,6 +405,15 @@ const char *dev_get_uclass_name(const struct udevice *dev);
int device_get_child(struct udevice *parent, int index, struct udevice **devp);
/**
+ * device_get_child_count() - Get the available child count of a device
+ *
+ * Returns the number of children to a device.
+ *
+ * @parent: Parent device to check
+ */
+int device_get_child_count(struct udevice *parent);
+
+/**
* device_find_child_by_seq() - Find a child device based on a sequence
*
* This searches for a device with the given seq or req_seq.