diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-04-23 23:53:04 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-24 08:09:02 -0400 |
commit | 30686ba6d56858657829d3eb524ed73e5dc98d2b (patch) | |
tree | 42bf3cea4dc7028fec30377560b367cd8274825e /arch/powerpc/platforms/powermac/setup.c | |
parent | 1658ab66781d918f604c6069c5cf9a94b6f52f84 (diff) |
[POWERPC] Remove old interface find_devices
Replace uses with of_find_node_by_name and for_each_node_by_name.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac/setup.c')
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index ae37d3e23783..0444e07e8d7a 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -193,8 +193,11 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
193 | #ifndef CONFIG_ADB_CUDA | 193 | #ifndef CONFIG_ADB_CUDA |
194 | int find_via_cuda(void) | 194 | int find_via_cuda(void) |
195 | { | 195 | { |
196 | if (!find_devices("via-cuda")) | 196 | struct device_node *dn = of_find_node_by_name(NULL, "via-cuda"); |
197 | |||
198 | if (!dn) | ||
197 | return 0; | 199 | return 0; |
200 | of_node_put(dn); | ||
198 | printk("WARNING ! Your machine is CUDA-based but your kernel\n"); | 201 | printk("WARNING ! Your machine is CUDA-based but your kernel\n"); |
199 | printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n"); | 202 | printk(" wasn't compiled with CONFIG_ADB_CUDA option !\n"); |
200 | return 0; | 203 | return 0; |
@@ -204,8 +207,11 @@ int find_via_cuda(void) | |||
204 | #ifndef CONFIG_ADB_PMU | 207 | #ifndef CONFIG_ADB_PMU |
205 | int find_via_pmu(void) | 208 | int find_via_pmu(void) |
206 | { | 209 | { |
207 | if (!find_devices("via-pmu")) | 210 | struct device_node *dn = of_find_node_by_name(NULL, "via-pmu"); |
211 | |||
212 | if (!dn) | ||
208 | return 0; | 213 | return 0; |
214 | of_node_put(dn); | ||
209 | printk("WARNING ! Your machine is PMU-based but your kernel\n"); | 215 | printk("WARNING ! Your machine is PMU-based but your kernel\n"); |
210 | printk(" wasn't compiled with CONFIG_ADB_PMU option !\n"); | 216 | printk(" wasn't compiled with CONFIG_ADB_PMU option !\n"); |
211 | return 0; | 217 | return 0; |
@@ -225,6 +231,8 @@ static volatile u32 *sysctrl_regs; | |||
225 | 231 | ||
226 | static void __init ohare_init(void) | 232 | static void __init ohare_init(void) |
227 | { | 233 | { |
234 | struct device_node *dn; | ||
235 | |||
228 | /* this area has the CPU identification register | 236 | /* this area has the CPU identification register |
229 | and some registers used by smp boards */ | 237 | and some registers used by smp boards */ |
230 | sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000); | 238 | sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000); |
@@ -234,7 +242,9 @@ static void __init ohare_init(void) | |||
234 | * We assume that we have a PSX memory controller iff | 242 | * We assume that we have a PSX memory controller iff |
235 | * we have an ohare I/O controller. | 243 | * we have an ohare I/O controller. |
236 | */ | 244 | */ |
237 | if (find_devices("ohare") != NULL) { | 245 | dn = of_find_node_by_name(NULL, "ohare"); |
246 | if (dn) { | ||
247 | of_node_put(dn); | ||
238 | if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) { | 248 | if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) { |
239 | if (sysctrl_regs[4] & 0x10) | 249 | if (sysctrl_regs[4] & 0x10) |
240 | sysctrl_regs[4] |= 0x04000020; | 250 | sysctrl_regs[4] |= 0x04000020; |
@@ -343,8 +353,15 @@ static void __init pmac_setup_arch(void) | |||
343 | 353 | ||
344 | #ifdef CONFIG_SMP | 354 | #ifdef CONFIG_SMP |
345 | /* Check for Core99 */ | 355 | /* Check for Core99 */ |
346 | if (find_devices("uni-n") || find_devices("u3") || find_devices("u4")) | 356 | ic = of_find_node_by_name(NULL, "uni-n"); |
357 | if (!ic) | ||
358 | ic = of_find_node_by_name(NULL, "u3"); | ||
359 | if (!ic) | ||
360 | ic = of_find_node_by_name(NULL, "u4"); | ||
361 | if (ic) { | ||
362 | of_node_put(ic); | ||
347 | smp_ops = &core99_smp_ops; | 363 | smp_ops = &core99_smp_ops; |
364 | } | ||
348 | #ifdef CONFIG_PPC32 | 365 | #ifdef CONFIG_PPC32 |
349 | else | 366 | else |
350 | smp_ops = &psurge_smp_ops; | 367 | smp_ops = &psurge_smp_ops; |