diff options
Diffstat (limited to 'include/linux/of.h')
| -rw-r--r-- | include/linux/of.h | 16 | 
1 files changed, 14 insertions, 2 deletions
| diff --git a/include/linux/of.h b/include/linux/of.h index cad7cf0ab27..266db1d0baa 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -23,8 +23,6 @@ | |||
| 23 | 23 | ||
| 24 | #include <asm/byteorder.h> | 24 | #include <asm/byteorder.h> | 
| 25 | 25 | ||
| 26 | #ifdef CONFIG_OF | ||
| 27 | |||
| 28 | typedef u32 phandle; | 26 | typedef u32 phandle; | 
| 29 | typedef u32 ihandle; | 27 | typedef u32 ihandle; | 
| 30 | 28 | ||
| @@ -65,11 +63,18 @@ struct device_node { | |||
| 65 | #endif | 63 | #endif | 
| 66 | }; | 64 | }; | 
| 67 | 65 | ||
| 66 | #ifdef CONFIG_OF | ||
| 67 | |||
| 68 | /* Pointer for first entry in chain of all nodes. */ | 68 | /* Pointer for first entry in chain of all nodes. */ | 
| 69 | extern struct device_node *allnodes; | 69 | 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 */ | 
