From 5c334eed6ecd66cebfbc80267149e755510d8bc8 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Tue, 2 Jan 2007 23:29:53 +0100 Subject: [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 Acked-by: Grant Likely Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/52xx/mpc52xx_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/powerpc/platforms/52xx/mpc52xx_common.c') 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: if (xlb) iounmap(xlb); } -static int __init +void __init mpc52xx_declare_of_platform_devices(void) { /* Find every child of the SOC node and add it to of_platform */ - return of_platform_bus_probe(NULL, NULL, NULL); + if (of_platform_bus_probe(NULL, NULL, NULL)) + printk(KERN_ERR __FILE__ ": " + "Error while probing of_platform bus\n"); } -device_initcall(mpc52xx_declare_of_platform_devices); -- cgit v1.2.3-59-g8ed1b