diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2007-02-17 10:10:44 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-02-17 10:10:44 -0500 |
commit | 336c3c2ec7e24bdf01c8f0c311ac7081b1f73d72 (patch) | |
tree | 516683b63acb2e8c5e7a6541ff2fce3496a33457 /arch/powerpc/platforms/83xx | |
parent | 6624b35d6250632497c5943faa2ee2a91344d91c (diff) |
[POWERPC] 83xx: Cleaning up machine probing and board initcalls
Cleaned up the probing functionality to be more consistent across all 83xx
boards and added machine_is() protection around board initcalls to ensure they
only do something if we are actually running on that board.
Additionally, removed some dead code on mpc832x_mds.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/83xx')
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc8313_rdb.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_mds.c | 23 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc834x_itx.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc834x_mds.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc8360e_pb.c | 17 |
5 files changed, 27 insertions, 41 deletions
diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c index c3b98c34eb6b..32e9e9492841 100644 --- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c | |||
@@ -74,16 +74,9 @@ void __init mpc8313_rdb_init_IRQ(void) | |||
74 | */ | 74 | */ |
75 | static int __init mpc8313_rdb_probe(void) | 75 | static int __init mpc8313_rdb_probe(void) |
76 | { | 76 | { |
77 | char *model = of_get_flat_dt_prop(of_get_flat_dt_root(), | 77 | unsigned long root = of_get_flat_dt_root(); |
78 | "model", NULL); | ||
79 | if (model == NULL) | ||
80 | return 0; | ||
81 | if (strcmp(model, "MPC8313ERDB")) | ||
82 | return 0; | ||
83 | 78 | ||
84 | DBG("MPC8313 RDB found\n"); | 79 | return of_flat_dt_is_compatible(root, "MPC8313ERDB"); |
85 | |||
86 | return 1; | ||
87 | } | 80 | } |
88 | 81 | ||
89 | define_machine(mpc8313_rdb) { | 82 | define_machine(mpc8313_rdb) { |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index 3ecb55f8a6e2..c6bfe72893d4 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c | |||
@@ -57,11 +57,6 @@ unsigned long isa_mem_base = 0; | |||
57 | 57 | ||
58 | static u8 *bcsr_regs = NULL; | 58 | static u8 *bcsr_regs = NULL; |
59 | 59 | ||
60 | u8 *get_bcsr(void) | ||
61 | { | ||
62 | return bcsr_regs; | ||
63 | } | ||
64 | |||
65 | /* ************************************************************************ | 60 | /* ************************************************************************ |
66 | * | 61 | * |
67 | * Setup the architecture | 62 | * Setup the architecture |
@@ -140,6 +135,9 @@ static int __init mpc832x_declare_of_platform_devices(void) | |||
140 | { | 135 | { |
141 | struct device_node *np; | 136 | struct device_node *np; |
142 | 137 | ||
138 | if (!machine_is(mpc832x_mds)) | ||
139 | return 0; | ||
140 | |||
143 | for (np = NULL; (np = of_find_compatible_node(np, "network", | 141 | for (np = NULL; (np = of_find_compatible_node(np, "network", |
144 | "ucc_geth")) != NULL;) { | 142 | "ucc_geth")) != NULL;) { |
145 | int ucc_num; | 143 | int ucc_num; |
@@ -189,6 +187,9 @@ static int __init mpc832x_rtc_hookup(void) | |||
189 | { | 187 | { |
190 | struct timespec tv; | 188 | struct timespec tv; |
191 | 189 | ||
190 | if (!machine_is(mpc832x_mds)) | ||
191 | return 0; | ||
192 | |||
192 | ppc_md.get_rtc_time = ds1374_get_rtc_time; | 193 | ppc_md.get_rtc_time = ds1374_get_rtc_time; |
193 | ppc_md.set_rtc_time = ds1374_set_rtc_time; | 194 | ppc_md.set_rtc_time = ds1374_set_rtc_time; |
194 | 195 | ||
@@ -207,17 +208,9 @@ late_initcall(mpc832x_rtc_hookup); | |||
207 | */ | 208 | */ |
208 | static int __init mpc832x_sys_probe(void) | 209 | static int __init mpc832x_sys_probe(void) |
209 | { | 210 | { |
210 | char *model = of_get_flat_dt_prop(of_get_flat_dt_root(), | 211 | unsigned long root = of_get_flat_dt_root(); |
211 | "model", NULL); | ||
212 | |||
213 | if (model == NULL) | ||
214 | return 0; | ||
215 | if (strcmp(model, "MPC8323EMDS")) | ||
216 | return 0; | ||
217 | |||
218 | DBG("%s found\n", model); | ||
219 | 212 | ||
220 | return 1; | 213 | return of_flat_dt_is_compatible(root, "MPC832xMDS"); |
221 | } | 214 | } |
222 | 215 | ||
223 | define_machine(mpc832x_mds) { | 216 | define_machine(mpc832x_mds) { |
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c index 443a3172f370..a8f66fb3391a 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c | |||
@@ -100,10 +100,9 @@ static void __init mpc834x_itx_init_IRQ(void) | |||
100 | */ | 100 | */ |
101 | static int __init mpc834x_itx_probe(void) | 101 | static int __init mpc834x_itx_probe(void) |
102 | { | 102 | { |
103 | /* We always match for now, eventually we should look at the flat | 103 | unsigned long root = of_get_flat_dt_root(); |
104 | dev tree to ensure this is the board we are suppose to run on | 104 | |
105 | */ | 105 | return of_flat_dt_is_compatible(root, "MPC834xMITX"); |
106 | return 1; | ||
107 | } | 106 | } |
108 | 107 | ||
109 | define_machine(mpc834x_itx) { | 108 | define_machine(mpc834x_itx) { |
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c index d2736da76c46..9fd9adf8ff99 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c | |||
@@ -176,6 +176,9 @@ static int __init mpc834x_rtc_hookup(void) | |||
176 | { | 176 | { |
177 | struct timespec tv; | 177 | struct timespec tv; |
178 | 178 | ||
179 | if (!machine_is(mpc834x_mds)) | ||
180 | return 0; | ||
181 | |||
179 | ppc_md.get_rtc_time = ds1374_get_rtc_time; | 182 | ppc_md.get_rtc_time = ds1374_get_rtc_time; |
180 | ppc_md.set_rtc_time = ds1374_set_rtc_time; | 183 | ppc_md.set_rtc_time = ds1374_set_rtc_time; |
181 | 184 | ||
@@ -194,10 +197,9 @@ late_initcall(mpc834x_rtc_hookup); | |||
194 | */ | 197 | */ |
195 | static int __init mpc834x_mds_probe(void) | 198 | static int __init mpc834x_mds_probe(void) |
196 | { | 199 | { |
197 | /* We always match for now, eventually we should look at the flat | 200 | unsigned long root = of_get_flat_dt_root(); |
198 | dev tree to ensure this is the board we are suppose to run on | 201 | |
199 | */ | 202 | return of_flat_dt_is_compatible(root, "MPC834xMDS"); |
200 | return 1; | ||
201 | } | 203 | } |
202 | 204 | ||
203 | define_machine(mpc834x_mds) { | 205 | define_machine(mpc834x_mds) { |
diff --git a/arch/powerpc/platforms/83xx/mpc8360e_pb.c b/arch/powerpc/platforms/83xx/mpc8360e_pb.c index ccce2f9f283d..76fcb5bdb759 100644 --- a/arch/powerpc/platforms/83xx/mpc8360e_pb.c +++ b/arch/powerpc/platforms/83xx/mpc8360e_pb.c | |||
@@ -145,6 +145,9 @@ static int __init mpc8360_declare_of_platform_devices(void) | |||
145 | { | 145 | { |
146 | struct device_node *np; | 146 | struct device_node *np; |
147 | 147 | ||
148 | if (!machine_is(mpc8360_sys)) | ||
149 | return 0; | ||
150 | |||
148 | for (np = NULL; (np = of_find_compatible_node(np, "network", | 151 | for (np = NULL; (np = of_find_compatible_node(np, "network", |
149 | "ucc_geth")) != NULL;) { | 152 | "ucc_geth")) != NULL;) { |
150 | int ucc_num; | 153 | int ucc_num; |
@@ -194,6 +197,9 @@ static int __init mpc8360_rtc_hookup(void) | |||
194 | { | 197 | { |
195 | struct timespec tv; | 198 | struct timespec tv; |
196 | 199 | ||
200 | if (!machine_is(mpc8360_sys)) | ||
201 | return 0; | ||
202 | |||
197 | ppc_md.get_rtc_time = ds1374_get_rtc_time; | 203 | ppc_md.get_rtc_time = ds1374_get_rtc_time; |
198 | ppc_md.set_rtc_time = ds1374_set_rtc_time; | 204 | ppc_md.set_rtc_time = ds1374_set_rtc_time; |
199 | 205 | ||
@@ -212,16 +218,9 @@ late_initcall(mpc8360_rtc_hookup); | |||
212 | */ | 218 | */ |
213 | static int __init mpc8360_sys_probe(void) | 219 | static int __init mpc8360_sys_probe(void) |
214 | { | 220 | { |
215 | char *model = of_get_flat_dt_prop(of_get_flat_dt_root(), | 221 | unsigned long root = of_get_flat_dt_root(); |
216 | "model", NULL); | ||
217 | if (model == NULL) | ||
218 | return 0; | ||
219 | if (strcmp(model, "MPC8360EPB")) | ||
220 | return 0; | ||
221 | |||
222 | DBG("MPC8360EMDS-PB found\n"); | ||
223 | 222 | ||
224 | return 1; | 223 | return of_flat_dt_is_compatible(root, "MPC836xMDS"); |
225 | } | 224 | } |
226 | 225 | ||
227 | define_machine(mpc8360_sys) { | 226 | define_machine(mpc8360_sys) { |