diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 03:44:08 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 03:44:08 -0400 |
| commit | 1d2a1959fe534279cf37aba20b08c24c20840e52 (patch) | |
| tree | 67c0b9aa7fe22a44bf0b4af88947799203eb8f67 /include/linux/of.h | |
| parent | 5a79ce76e9bb8f4b2cd8106ee36d15ee05013bcf (diff) | |
| parent | 054cfaacf88865bff1dd58d305443d5d6c068a08 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh-latest
Diffstat (limited to 'include/linux/of.h')
| -rw-r--r-- | include/linux/of.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index cad7cf0ab278..bfc0ed1b0ced 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); |
| @@ -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 */ |
