diff options
| author | Michael Ellerman <michael@ellerman.id.au> | 2007-06-19 02:07:58 -0400 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2007-07-10 07:53:46 -0400 |
| commit | d3b814bb1e8b0c63449a3430196c20cbe24a3e67 (patch) | |
| tree | efc3e7df26def2a93768d78e55b0cc8bc4d96b80 /include | |
| parent | 972d17c9dbad378da61baa17f4c3ea6e154b186a (diff) | |
[POWERPC] Generalise device_node flag interface
The struct device_node currently has a _flags variable, although
it's only used for one flag - OF_DYNAMIC. Generalise the flag
accessors so we can use them with other flags in future.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-powerpc/prom.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 1122a9278afd..f1006b91bd1a 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
| @@ -98,10 +98,18 @@ struct device_node { | |||
| 98 | extern struct device_node *of_chosen; | 98 | extern 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 | |||
| 103 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | ||
| 104 | { | ||
| 105 | return test_bit(flag, &n->_flags); | ||
| 106 | } | ||
| 107 | |||
| 108 | static inline void of_node_set_flag(struct device_node *n, unsigned long flag) | ||
| 109 | { | ||
| 110 | set_bit(flag, &n->_flags); | ||
| 111 | } | ||
| 102 | 112 | ||
| 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 | 113 | ||
| 106 | #define HAVE_ARCH_DEVTREE_FIXUPS | 114 | #define HAVE_ARCH_DEVTREE_FIXUPS |
| 107 | 115 | ||
