diff options
Diffstat (limited to 'include/linux/of.h')
-rw-r--r-- | include/linux/of.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index d9dd664a6a9..266db1d0baa 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -70,6 +70,11 @@ extern struct device_node *allnodes; | |||
70 | extern struct device_node *of_chosen; | 70 | extern struct device_node *of_chosen; |
71 | extern rwlock_t devtree_lock; | 71 | extern rwlock_t devtree_lock; |
72 | 72 | ||
73 | static inline bool of_have_populated_dt(void) | ||
74 | { | ||
75 | return allnodes != NULL; | ||
76 | } | ||
77 | |||
73 | static inline bool of_node_is_root(const struct device_node *node) | 78 | static inline bool of_node_is_root(const struct device_node *node) |
74 | { | 79 | { |
75 | return node && (node->parent == NULL); | 80 | return node && (node->parent == NULL); |
@@ -222,5 +227,12 @@ extern void of_attach_node(struct device_node *); | |||
222 | extern void of_detach_node(struct device_node *); | 227 | extern void of_detach_node(struct device_node *); |
223 | #endif | 228 | #endif |
224 | 229 | ||
230 | #else | ||
231 | |||
232 | static inline bool of_have_populated_dt(void) | ||
233 | { | ||
234 | return false; | ||
235 | } | ||
236 | |||
225 | #endif /* CONFIG_OF */ | 237 | #endif /* CONFIG_OF */ |
226 | #endif /* _LINUX_OF_H */ | 238 | #endif /* _LINUX_OF_H */ |