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>
This commit is contained in:
Lokesh Vutla
2019-09-04 16:01:26 +05:30
committed by Tom Rini
parent bc74163a46
commit 240b932010
3 changed files with 35 additions and 26 deletions

View File

@@ -404,6 +404,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
*