]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - include/linux/of.h
Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
[mirror_ubuntu-zesty-kernel.git] / include / linux / of.h
index e3f942d9da89ba4cdf47cb7c3dc2ddb629699836..2ec1083af7ffba234db74acdd0e42d25d861b8c1 100644 (file)
@@ -193,6 +193,17 @@ extern struct device_node *of_get_next_child(const struct device_node *node,
        for (child = of_get_next_child(parent, NULL); child != NULL; \
             child = of_get_next_child(parent, child))
 
+static inline int of_get_child_count(const struct device_node *np)
+{
+       struct device_node *child;
+       int num = 0;
+
+       for_each_child_of_node(np, child)
+               num++;
+
+       return num;
+}
+
 extern struct device_node *of_find_node_with_property(
        struct device_node *from, const char *prop_name);
 #define for_each_node_with_property(dn, prop_name) \
@@ -300,6 +311,11 @@ static inline bool of_have_populated_dt(void)
 #define for_each_child_of_node(parent, child) \
        while (0)
 
+static inline int of_get_child_count(const struct device_node *np)
+{
+       return 0;
+}
+
 static inline int of_device_is_compatible(const struct device_node *device,
                                          const char *name)
 {