aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/prom.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/prom.h')
-rw-r--r--include/asm-powerpc/prom.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 6845af93ba91..1632baa17dc6 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -98,10 +98,19 @@ struct device_node {
98extern struct device_node *of_chosen; 98extern struct device_node *of_chosen;
99 99
100/* flag descriptions */ 100/* flag descriptions */
101#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ 101#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
102#define OF_DETACHED 2 /* node has been detached from the device tree */
103
104static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
105{
106 return test_bit(flag, &n->_flags);
107}
108
109static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
110{
111 set_bit(flag, &n->_flags);
112}
102 113
103#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
104#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
105 114
106#define HAVE_ARCH_DEVTREE_FIXUPS 115#define HAVE_ARCH_DEVTREE_FIXUPS
107 116
@@ -124,6 +133,9 @@ extern struct device_node *of_find_node_by_type(struct device_node *from,
124 dn = of_find_node_by_type(dn, type)) 133 dn = of_find_node_by_type(dn, type))
125extern struct device_node *of_find_compatible_node(struct device_node *from, 134extern struct device_node *of_find_compatible_node(struct device_node *from,
126 const char *type, const char *compat); 135 const char *type, const char *compat);
136#define for_each_compatible_node(dn, type, compatible) \
137 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
138 dn = of_find_compatible_node(dn, type, compatible))
127extern struct device_node *of_find_node_by_path(const char *path); 139extern struct device_node *of_find_node_by_path(const char *path);
128extern struct device_node *of_find_node_by_phandle(phandle handle); 140extern struct device_node *of_find_node_by_phandle(phandle handle);
129extern struct device_node *of_find_all_nodes(struct device_node *prev); 141extern struct device_node *of_find_all_nodes(struct device_node *prev);