diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2009-10-15 12:57:49 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-10-15 12:57:49 -0400 |
commit | 6f1924928377bd035a9f64466f91a487c69271d2 (patch) | |
tree | 1a162237e621a0d6ebcc2fca305d2c96d284e5a3 | |
parent | 731581e6a653f6a68a4d7ba9df6b886a85c7d080 (diff) |
of: merge struct device_node
Merge of common code duplicated between Sparc, 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.h | 20 | ||||
-rw-r--r-- | arch/powerpc/include/asm/prom.h | 20 | ||||
-rw-r--r-- | arch/sparc/include/asm/prom.h | 24 | ||||
-rw-r--r-- | include/linux/of.h | 32 |
4 files changed, 32 insertions, 64 deletions
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h index 11cb48419c7d..64e8b3a8c3cf 100644 --- a/arch/microblaze/include/asm/prom.h +++ b/arch/microblaze/include/asm/prom.h | |||
@@ -73,26 +73,6 @@ struct boot_param_header { | |||
73 | u32 dt_struct_size; /* size of the DT structure block */ | 73 | u32 dt_struct_size; /* size of the DT structure block */ |
74 | }; | 74 | }; |
75 | 75 | ||
76 | struct device_node { | ||
77 | const char *name; | ||
78 | const char *type; | ||
79 | phandle node; | ||
80 | phandle linux_phandle; | ||
81 | char *full_name; | ||
82 | |||
83 | struct property *properties; | ||
84 | struct property *deadprops; /* removed properties */ | ||
85 | struct device_node *parent; | ||
86 | struct device_node *child; | ||
87 | struct device_node *sibling; | ||
88 | struct device_node *next; /* next device of same type */ | ||
89 | struct device_node *allnext; /* next in list of all nodes */ | ||
90 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
91 | struct kref kref; | ||
92 | unsigned long _flags; | ||
93 | void *data; | ||
94 | }; | ||
95 | |||
96 | extern struct device_node *of_chosen; | 76 | extern struct device_node *of_chosen; |
97 | 77 | ||
98 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | 78 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) |
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index c236326177a8..c918db535f08 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h | |||
@@ -71,26 +71,6 @@ struct boot_param_header | |||
71 | u32 dt_struct_size; /* size of the DT structure block */ | 71 | u32 dt_struct_size; /* size of the DT structure block */ |
72 | }; | 72 | }; |
73 | 73 | ||
74 | struct device_node { | ||
75 | const char *name; | ||
76 | const char *type; | ||
77 | phandle node; | ||
78 | phandle linux_phandle; | ||
79 | char *full_name; | ||
80 | |||
81 | struct property *properties; | ||
82 | struct property *deadprops; /* removed properties */ | ||
83 | struct device_node *parent; | ||
84 | struct device_node *child; | ||
85 | struct device_node *sibling; | ||
86 | struct device_node *next; /* next device of same type */ | ||
87 | struct device_node *allnext; /* next in list of all nodes */ | ||
88 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
89 | struct kref kref; | ||
90 | unsigned long _flags; | ||
91 | void *data; | ||
92 | }; | ||
93 | |||
94 | extern struct device_node *of_chosen; | 74 | extern struct device_node *of_chosen; |
95 | 75 | ||
96 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | 76 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) |
diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h index b34f988a2aad..e5f4a1d8fc46 100644 --- a/arch/sparc/include/asm/prom.h +++ b/arch/sparc/include/asm/prom.h | |||
@@ -29,30 +29,6 @@ | |||
29 | #define of_prop_cmp(s1, s2) strcasecmp((s1), (s2)) | 29 | #define of_prop_cmp(s1, s2) strcasecmp((s1), (s2)) |
30 | #define of_node_cmp(s1, s2) strcmp((s1), (s2)) | 30 | #define of_node_cmp(s1, s2) strcmp((s1), (s2)) |
31 | 31 | ||
32 | struct of_irq_controller; | ||
33 | struct device_node { | ||
34 | const char *name; | ||
35 | const char *type; | ||
36 | phandle node; | ||
37 | char *path_component_name; | ||
38 | char *full_name; | ||
39 | |||
40 | struct property *properties; | ||
41 | struct property *deadprops; /* removed properties */ | ||
42 | struct device_node *parent; | ||
43 | struct device_node *child; | ||
44 | struct device_node *sibling; | ||
45 | struct device_node *next; /* next device of same type */ | ||
46 | struct device_node *allnext; /* next in list of all nodes */ | ||
47 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
48 | struct kref kref; | ||
49 | unsigned long _flags; | ||
50 | void *data; | ||
51 | unsigned int unique_id; | ||
52 | |||
53 | struct of_irq_controller *irq_trans; | ||
54 | }; | ||
55 | |||
56 | struct of_irq_controller { | 32 | struct of_irq_controller { |
57 | unsigned int (*irq_build)(struct device_node *, unsigned int, void *); | 33 | unsigned int (*irq_build)(struct device_node *, unsigned int, void *); |
58 | void *data; | 34 | void *data; |
diff --git a/include/linux/of.h b/include/linux/of.h index 4668b298479a..65a158dc7257 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
20 | #include <linux/kref.h> | ||
20 | #include <linux/mod_devicetable.h> | 21 | #include <linux/mod_devicetable.h> |
21 | 22 | ||
22 | typedef u32 phandle; | 23 | typedef u32 phandle; |
@@ -31,6 +32,37 @@ struct property { | |||
31 | unsigned int unique_id; | 32 | unsigned int unique_id; |
32 | }; | 33 | }; |
33 | 34 | ||
35 | #if defined(CONFIG_SPARC) | ||
36 | struct of_irq_controller; | ||
37 | #endif | ||
38 | |||
39 | struct device_node { | ||
40 | const char *name; | ||
41 | const char *type; | ||
42 | phandle node; | ||
43 | #if !defined(CONFIG_SPARC) | ||
44 | phandle linux_phandle; | ||
45 | #endif | ||
46 | char *full_name; | ||
47 | |||
48 | struct property *properties; | ||
49 | struct property *deadprops; /* removed properties */ | ||
50 | struct device_node *parent; | ||
51 | struct device_node *child; | ||
52 | struct device_node *sibling; | ||
53 | struct device_node *next; /* next device of same type */ | ||
54 | struct device_node *allnext; /* next in list of all nodes */ | ||
55 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
56 | struct kref kref; | ||
57 | unsigned long _flags; | ||
58 | void *data; | ||
59 | #if defined(CONFIG_SPARC) | ||
60 | char *path_component_name; | ||
61 | unsigned int unique_id; | ||
62 | struct of_irq_controller *irq_trans; | ||
63 | #endif | ||
64 | }; | ||
65 | |||
34 | #include <asm/prom.h> | 66 | #include <asm/prom.h> |
35 | 67 | ||
36 | /* flag descriptions */ | 68 | /* flag descriptions */ |