aboutsummaryrefslogtreecommitdiff
path: root/lib/fdtdec_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fdtdec_common.c')
-rw-r--r--lib/fdtdec_common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/fdtdec_common.c b/lib/fdtdec_common.c
index 088e9e9063a..5775992ef33 100644
--- a/lib/fdtdec_common.c
+++ b/lib/fdtdec_common.c
@@ -53,3 +53,14 @@ unsigned int fdtdec_get_uint(const void *blob, int node, const char *prop_name,
debug("(not found)\n");
return default_val;
}
+
+int fdtdec_get_child_count(const void *blob, int node)
+{
+ int subnode;
+ int num = 0;
+
+ fdt_for_each_subnode(subnode, blob, node)
+ num++;
+
+ return num;
+}