]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
mach-omap2: fix more arch_initcall() breakage
authorDavid Brownell <dbrownell@users.sourceforge.net>
Thu, 11 Sep 2008 06:01:24 +0000 (23:01 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 12 Sep 2008 17:22:52 +0000 (10:22 -0700)
Remove more bogus arch_initcall() logic in mach-omap2/board-xyx.c files.
They broke a multi-OMAP build I did, at *RUN TIME* not build time, since
it tried to do the i2c init for every board linked in the kernel.

Remember, init_machine() entries run at arch_initcall() time; that's
where any board-specific init logic should normally go.  Any initcalls
in the mach-*/*c files should normally be guarded by tests to make sure
they only run on the relevant hardware (board, cpu).  Better yet, get
rid of the initcalls; init_machine() can *explicitly* call the right
version of that code, and pass in board-specific config data; and there
are hooks that can handle cpu-specific stuff too.

A quick glance suggests most of the remaining initcall logic in the
mach-omap2 directory is similarly broken... this patch gets rid of
one frequently-cloned idiom, it should help.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-omap2evm.c
arch/arm/mach-omap2/board-omap3evm.c

index 22aa28c7fcb85edf2fb91ec18c2984546388c04b..73df3269d081b3f1799ded83cb4957401bda211b 100644 (file)
@@ -384,6 +384,8 @@ static int __init omap2430_i2c_init(void)
 
 static void __init omap_2430sdp_init(void)
 {
+       omap2430_i2c_init();
+
        platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
        omap_board_config = sdp2430_config;
        omap_board_config_size = ARRAY_SIZE(sdp2430_config);
@@ -408,8 +410,6 @@ static void __init omap_2430sdp_map_io(void)
        omap2_map_common_io();
 }
 
-arch_initcall(omap2430_i2c_init);
-
 MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
        /* Maintainer: Syed Khasim - Texas Instruments Inc */
        .phys_io        = 0x48000000,
index a9f368b4e10176d2320ca81a5f803093878f2747..004955a6f8554797f4515460be57e7b930a5c72e 100644 (file)
@@ -346,6 +346,7 @@ extern void __init sdp3430_flash_init(void);
 
 static void __init omap_3430sdp_init(void)
 {
+       omap3430_i2c_init();
        platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
        omap_board_config = sdp3430_config;
        omap_board_config_size = ARRAY_SIZE(sdp3430_config);
@@ -370,7 +371,6 @@ static void __init omap_3430sdp_map_io(void)
        omap2_set_globals_343x();
        omap2_map_common_io();
 }
-arch_initcall(omap3430_i2c_init);
 
 MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
        /* Maintainer: Syed Khasim - Texas Instruments Inc */
index ffd27d676ce0aac63aec44622bb58a5752fe89a3..c7b67857fa91709e5d63cb5b6cc02ff1e0c992e0 100644 (file)
@@ -215,6 +215,7 @@ static int __init omap_i2c_init(void)
 
 static void __init omap_ldp_init(void)
 {
+       omap_i2c_init();
        platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
        omap_board_config = ldp_config;
        omap_board_config_size = ARRAY_SIZE(ldp_config);
@@ -234,7 +235,6 @@ static void __init omap_ldp_map_io(void)
        omap2_set_globals_343x();
        omap2_map_common_io();
 }
-arch_initcall(omap_i2c_init);
 
 MACHINE_START(OMAP_LDP, "OMAP LDP board")
        .phys_io        = 0x48000000,
index d55f6f7b7e845c04e1bef18e6fb9b284c9eeeb4f..6cf9db846f89d04ba91d83b46596c441aa74c608 100644 (file)
@@ -253,6 +253,8 @@ static struct platform_device *omap2_evm_devices[] __initdata = {
 
 static void __init omap2_evm_init(void)
 {
+       omap2_evm_i2c_init();
+
        platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
        omap_board_config = omap2_evm_config;
        omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
@@ -267,8 +269,6 @@ static void __init omap2_evm_map_io(void)
        omap2_map_common_io();
 }
 
-arch_initcall(omap2_evm_i2c_init);
-
 MACHINE_START(OMAP2EVM, "OMAP2EVM Board")
        /* Maintainer:  Arun KS <arunks@mistralsolutions.com> */
        .phys_io        = 0x48000000,
index ee8a84d3a43eccc871d60cafff0f88ad8061dea5..e7680374e2df5fb328c1ebb1c91b5f264ab7f08e 100644 (file)
@@ -215,6 +215,8 @@ static struct platform_device *omap3_evm_devices[] __initdata = {
 
 static void __init omap3_evm_init(void)
 {
+       omap3_evm_i2c_init();
+
        platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
        omap_board_config = omap3_evm_config;
        omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
@@ -230,8 +232,6 @@ static void __init omap3_evm_init(void)
        ads7846_dev_init();
 }
 
-arch_initcall(omap3_evm_i2c_init);
-
 static void __init omap3_evm_map_io(void)
 {
        omap2_set_globals_343x();