From 89b84b85e9c5d80e1b5eb5b52cc6596ba32135c7 Mon Sep 17 00:00:00 2001 From: Chunfeng Yun Date: Sat, 2 May 2020 11:35:09 +0200 Subject: dm: core: Add function to get child count of ofnode or device This patch add function used to get the child count of a ofnode or a device Signed-off-by: Chunfeng Yun Signed-off-by: Frank Wunderlich Reviewed-by: Weijie Gao Reviewed-by: Simon Glass --- include/dm/ofnode.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/dm/ofnode.h') diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 618fc10390e..a0d3df77868 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -879,6 +879,14 @@ ofnode ofnode_by_prop_value(ofnode from, const char *propname, ofnode_valid(node); \ node = ofnode_next_subnode(node)) +/** + * ofnode_get_child_count() - get the child count of a ofnode + * + * @node: valid node to get its child count + * @return the number of subnodes + */ +int ofnode_get_child_count(ofnode parent); + /** * ofnode_translate_address() - Translate a device-tree address * -- cgit v1.2.3