diff options
-rw-r--r-- | include/linux/of.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index f95aee391e30..54c25606a997 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -226,6 +226,17 @@ static inline int of_get_child_count(const struct device_node *np) | |||
226 | return num; | 226 | return num; |
227 | } | 227 | } |
228 | 228 | ||
229 | static inline int of_get_available_child_count(const struct device_node *np) | ||
230 | { | ||
231 | struct device_node *child; | ||
232 | int num = 0; | ||
233 | |||
234 | for_each_available_child_of_node(np, child) | ||
235 | num++; | ||
236 | |||
237 | return num; | ||
238 | } | ||
239 | |||
229 | extern struct device_node *of_find_node_with_property( | 240 | extern struct device_node *of_find_node_with_property( |
230 | struct device_node *from, const char *prop_name); | 241 | struct device_node *from, const char *prop_name); |
231 | #define for_each_node_with_property(dn, prop_name) \ | 242 | #define for_each_node_with_property(dn, prop_name) \ |
@@ -376,6 +387,11 @@ static inline int of_get_child_count(const struct device_node *np) | |||
376 | return 0; | 387 | return 0; |
377 | } | 388 | } |
378 | 389 | ||
390 | static inline int of_get_available_child_count(const struct device_node *np) | ||
391 | { | ||
392 | return 0; | ||
393 | } | ||
394 | |||
379 | static inline int of_device_is_compatible(const struct device_node *device, | 395 | static inline int of_device_is_compatible(const struct device_node *device, |
380 | const char *name) | 396 | const char *name) |
381 | { | 397 | { |