diff options
Diffstat (limited to 'include/linux/of.h')
| -rw-r--r-- | include/linux/of.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index d9dd664a6a9c..bfc0ed1b0ced 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); |
| @@ -103,7 +108,7 @@ extern void of_node_put(struct device_node *node); | |||
| 103 | #endif | 108 | #endif |
| 104 | 109 | ||
| 105 | /* | 110 | /* |
| 106 | * OF address retreival & translation | 111 | * OF address retrieval & translation |
| 107 | */ | 112 | */ |
| 108 | 113 | ||
| 109 | /* Helper to read a big number; size is in cells (not bytes) */ | 114 | /* Helper to read a big number; size is in cells (not bytes) */ |
| @@ -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 */ |
