X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Ffdtdec_common.c;h=ddaca0087e19d97091677ea8ed8bcfab24f60c95;hb=cb6c9c83e2f1cb5b96851445dbf3dea8541cb212;hp=088e9e9063a92b378912fefdc46c74cc84ee892d;hpb=e8f80a5a58c9b506453cc0780687e8ed457d30a6;p=pandora-u-boot.git diff --git a/lib/fdtdec_common.c b/lib/fdtdec_common.c index 088e9e9063..ddaca0087e 100644 --- a/lib/fdtdec_common.c +++ b/lib/fdtdec_common.c @@ -9,6 +9,7 @@ #ifndef USE_HOSTCC #include +#include #include #include #else @@ -53,3 +54,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; +}