avr32: Fix GPIO initcall breakage
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Thu, 23 Oct 2008 12:42:19 +0000 (14:42 +0200)
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Thu, 23 Oct 2008 13:18:33 +0000 (15:18 +0200)
Add essential system devices, including GPIO controllers, automatically
at core_initcall time. This ensures that the devices are there when the
PIO driver gets initialized at postcore_initcall, fixing a bug exposed
by commit d6634db8fe1784d0a8e4e156970fec034708446e "avr32: Use
platform_driver_probe for pio platform driver".

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
arch/avr32/boards/atngw100/setup.c
arch/avr32/boards/atstk1000/atstk1002.c
arch/avr32/boards/atstk1000/atstk1003.c
arch/avr32/boards/atstk1000/atstk1004.c
arch/avr32/mach-at32ap/at32ap700x.c
arch/avr32/mach-at32ap/include/mach/board.h

index 6c54580a66df77bdcba2d1e889c95ba9b6524291..259ceee02b6291c73d4b7cea5e158b40c0628e41 100644 (file)
@@ -172,8 +172,6 @@ static int __init atngw100_init(void)
         * reserve any pins for it.
         */
 
-       at32_add_system_devices();
-
        at32_add_device_usart(0);
 
        set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
index 29e5b51a7fd2b8801a23655e17edcff41ade6ab2..5c5cdf3b464fb8d99394e408ed49b700babc1ec4 100644 (file)
@@ -305,8 +305,6 @@ static int __init atstk1002_init(void)
        at32_reserve_pin(GPIO_PIN_PE(15));      /* DATA[31]     */
        at32_reserve_pin(GPIO_PIN_PE(26));      /* SDCS         */
 
-       at32_add_system_devices();
-
 #ifdef CONFIG_BOARD_ATSTK1006
        smc_set_timing(&nand_config, &nand_timing);
        smc_set_configuration(3, &nand_config);
index be089d7f37ebf1b0fe955475417fce4fb66e86f9..134b566630b0f62a75aad5832278c4dcf7aeac91 100644 (file)
@@ -149,8 +149,6 @@ static int __init atstk1003_init(void)
        at32_reserve_pin(GPIO_PIN_PE(15));      /* DATA[31]     */
        at32_reserve_pin(GPIO_PIN_PE(26));      /* SDCS         */
 
-       at32_add_system_devices();
-
 #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
        at32_add_device_usart(1);
 #else
index 248ef237c167b95283c30dec20ca0080c97e6feb..cb32eb844aa743ca69d7ff181353ad669330832d 100644 (file)
@@ -132,8 +132,6 @@ void __init setup_board(void)
 
 static int __init atstk1004_init(void)
 {
-       at32_add_system_devices();
-
 #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
        at32_add_device_usart(1);
 #else
index 8c435a6f4a6caa7d6dca710c2996cef645e93718..748ac68c73dcb0bf0e1367dbf5f3c0afddd8e02f 100644 (file)
@@ -813,7 +813,7 @@ static struct resource pio4_resource[] = {
 DEFINE_DEV(pio, 4);
 DEV_CLK(mck, pio4, pba, 14);
 
-void __init at32_add_system_devices(void)
+static int __init system_device_init(void)
 {
        platform_device_register(&at32_pm0_device);
        platform_device_register(&at32_intc0_device);
@@ -832,7 +832,10 @@ void __init at32_add_system_devices(void)
        platform_device_register(&pio2_device);
        platform_device_register(&pio3_device);
        platform_device_register(&pio4_device);
+
+       return 0;
 }
+core_initcall(system_device_init);
 
 /* --------------------------------------------------------------------
  *  PSIF
index c48386d66bc38f9fb0c1e287748b6de16a8ac903..aafaf7a78886951ed50017c6d414e6b5758cff05 100644 (file)
  */
 extern unsigned long at32_board_osc_rates[];
   
-/* Add basic devices: system manager, interrupt controller, portmuxes, etc. */
-void at32_add_system_devices(void);
+/*
+ * This used to add essential system devices, but this is now done
+ * automatically. Please don't use it in new board code.
+ */
+static inline void __deprecated at32_add_system_devices(void)
+{
+
+}
 
 #define ATMEL_MAX_UART 4
 extern struct platform_device *atmel_default_console_device;