diff options
Diffstat (limited to 'include')
| -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 e3f942d9da89..2ec1083af7ff 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -193,6 +193,17 @@ extern struct device_node *of_get_next_child(const struct device_node *node, | |||
| 193 | for (child = of_get_next_child(parent, NULL); child != NULL; \ | 193 | for (child = of_get_next_child(parent, NULL); child != NULL; \ |
| 194 | child = of_get_next_child(parent, child)) | 194 | child = of_get_next_child(parent, child)) |
| 195 | 195 | ||
| 196 | static inline int of_get_child_count(const struct device_node *np) | ||
| 197 | { | ||
| 198 | struct device_node *child; | ||
| 199 | int num = 0; | ||
| 200 | |||
| 201 | for_each_child_of_node(np, child) | ||
| 202 | num++; | ||
| 203 | |||
| 204 | return num; | ||
| 205 | } | ||
| 206 | |||
| 196 | extern struct device_node *of_find_node_with_property( | 207 | extern struct device_node *of_find_node_with_property( |
| 197 | struct device_node *from, const char *prop_name); | 208 | struct device_node *from, const char *prop_name); |
| 198 | #define for_each_node_with_property(dn, prop_name) \ | 209 | #define for_each_node_with_property(dn, prop_name) \ |
| @@ -300,6 +311,11 @@ static inline bool of_have_populated_dt(void) | |||
| 300 | #define for_each_child_of_node(parent, child) \ | 311 | #define for_each_child_of_node(parent, child) \ |
| 301 | while (0) | 312 | while (0) |
| 302 | 313 | ||
| 314 | static inline int of_get_child_count(const struct device_node *np) | ||
| 315 | { | ||
| 316 | return 0; | ||
| 317 | } | ||
| 318 | |||
| 303 | static inline int of_device_is_compatible(const struct device_node *device, | 319 | static inline int of_device_is_compatible(const struct device_node *device, |
| 304 | const char *name) | 320 | const char *name) |
| 305 | { | 321 | { |
