aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2007-01-02 17:29:53 -0500
committerPaul Mackerras <paulus@samba.org>2007-01-09 01:03:02 -0500
commit5c334eed6ecd66cebfbc80267149e755510d8bc8 (patch)
tree567327796d40a48009dde7f8df947f6a63897efa /arch/powerpc
parent56c336cb05d58991f3e9d5f0ec098ba0f219a15e (diff)
[POWERPC] 52xx: Don't use device_initcall to probe of_platform_bus
Using device_initcall makes it happen for every platform that compiles this file in. This is really bad, for obvious reasons. Instead, we use the .init field of the machine description. If the platform needs the hook to do something specific it can provides its own function and call mpc52xx_declare_of_platform_devices from there. If not, the mpc52xx_declare_of_platform_devices function can directly be used as the init hook. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c1
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index eaff71e74fb0..0f21bab33f6c 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -153,6 +153,7 @@ define_machine(lite52xx) {
153 .name = "lite52xx", 153 .name = "lite52xx",
154 .probe = lite52xx_probe, 154 .probe = lite52xx_probe,
155 .setup_arch = lite52xx_setup_arch, 155 .setup_arch = lite52xx_setup_arch,
156 .init = mpc52xx_declare_of_platform_devices,
156 .init_IRQ = mpc52xx_init_irq, 157 .init_IRQ = mpc52xx_init_irq,
157 .get_irq = mpc52xx_get_irq, 158 .get_irq = mpc52xx_get_irq,
158 .show_cpuinfo = lite52xx_show_cpuinfo, 159 .show_cpuinfo = lite52xx_show_cpuinfo,
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 8331ff457770..cc40889074bd 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -116,11 +116,12 @@ unmap_regs:
116 if (xlb) iounmap(xlb); 116 if (xlb) iounmap(xlb);
117} 117}
118 118
119static int __init 119void __init
120mpc52xx_declare_of_platform_devices(void) 120mpc52xx_declare_of_platform_devices(void)
121{ 121{
122 /* Find every child of the SOC node and add it to of_platform */ 122 /* Find every child of the SOC node and add it to of_platform */
123 return of_platform_bus_probe(NULL, NULL, NULL); 123 if (of_platform_bus_probe(NULL, NULL, NULL))
124 printk(KERN_ERR __FILE__ ": "
125 "Error while probing of_platform bus\n");
124} 126}
125 127
126device_initcall(mpc52xx_declare_of_platform_devices);