aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2009-10-15 12:57:58 -0400
committerGrant Likely <grant.likely@secretlab.ca>2009-10-15 12:57:58 -0400
commit50436312f47f1fd2bf82c983638fe27ca7e03238 (patch)
tree744c7c52e266d4c0c8f5feb88f109e5e77dd191e
parentd45d94f672e3c79b0db1e6d76e1638ee521d56c0 (diff)
of: merge of_node_*_flag() and set_node_proc_entry()
Merge common code between PowerPC and Microblaze Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Michal Simek <monstr@monstr.eu> Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--arch/microblaze/include/asm/prom.h16
-rw-r--r--arch/powerpc/include/asm/prom.h17
-rw-r--r--include/linux/of.h16
3 files changed, 16 insertions, 33 deletions
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index dfc4afcdbd2b..180d84481306 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -35,24 +35,8 @@
35 35
36extern struct device_node *of_chosen; 36extern struct device_node *of_chosen;
37 37
38static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
39{
40 return test_bit(flag, &n->_flags);
41}
42
43static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
44{
45 set_bit(flag, &n->_flags);
46}
47
48#define HAVE_ARCH_DEVTREE_FIXUPS 38#define HAVE_ARCH_DEVTREE_FIXUPS
49 39
50static inline void set_node_proc_entry(struct device_node *dn,
51 struct proc_dir_entry *de)
52{
53 dn->pde = de;
54}
55
56extern struct device_node *allnodes; /* temporary while merging */ 40extern struct device_node *allnodes; /* temporary while merging */
57extern rwlock_t devtree_lock; /* temporary while merging */ 41extern rwlock_t devtree_lock; /* temporary while merging */
58 42
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index ef20e6c23235..2cfd43288a3e 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -32,25 +32,8 @@
32 32
33extern struct device_node *of_chosen; 33extern struct device_node *of_chosen;
34 34
35static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
36{
37 return test_bit(flag, &n->_flags);
38}
39
40static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
41{
42 set_bit(flag, &n->_flags);
43}
44
45
46#define HAVE_ARCH_DEVTREE_FIXUPS 35#define HAVE_ARCH_DEVTREE_FIXUPS
47 36
48static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
49{
50 dn->pde = de;
51}
52
53
54extern struct device_node *of_find_all_nodes(struct device_node *prev); 37extern struct device_node *of_find_all_nodes(struct device_node *prev);
55extern struct device_node *of_node_get(struct device_node *node); 38extern struct device_node *of_node_get(struct device_node *node);
56extern void of_node_put(struct device_node *node); 39extern void of_node_put(struct device_node *node);
diff --git a/include/linux/of.h b/include/linux/of.h
index a66c1eb31693..d5f666290f6b 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -63,6 +63,22 @@ struct device_node {
63#endif 63#endif
64}; 64};
65 65
66static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
67{
68 return test_bit(flag, &n->_flags);
69}
70
71static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
72{
73 set_bit(flag, &n->_flags);
74}
75
76static inline void
77set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
78{
79 dn->pde = de;
80}
81
66#include <asm/prom.h> 82#include <asm/prom.h>
67 83
68/* flag descriptions */ 84/* flag descriptions */