From 240b93201007183d5fd651a210ddb4c50ee30980 Mon Sep 17 00:00:00 2001 From: Lokesh Vutla Date: Wed, 4 Sep 2019 16:01:26 +0530 Subject: 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 --- include/dm/device.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') 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 @@ -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 * -- cgit v1.2.3