test: Remove duplicate macro
[pandora-u-boot.git] / lib / fdtdec_common.c
index 088e9e9..ddaca00 100644 (file)
@@ -9,6 +9,7 @@
 
 #ifndef USE_HOSTCC
 #include <common.h>
+#include <log.h>
 #include <linux/libfdt.h>
 #include <fdtdec.h>
 #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;
+}