[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>
This commit is contained in:
Michael Ellerman
2007-06-19 16:07:58 +10:00
committed by Paul Mackerras
parent 972d17c9db
commit d3b814bb1e
3 changed files with 13 additions and 5 deletions

View File

@@ -98,10 +98,18 @@ struct device_node {
extern struct device_node *of_chosen;
/* flag descriptions */
#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
{
return test_bit(flag, &n->_flags);
}
static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
{
set_bit(flag, &n->_flags);
}
#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
#define HAVE_ARCH_DEVTREE_FIXUPS