omap1: Add initcall checks for omap1 and booted board
authorTony Lindgren <tony@atomide.com>
Fri, 10 Dec 2010 17:46:24 +0000 (09:46 -0800)
committerTony Lindgren <tony@atomide.com>
Fri, 10 Dec 2010 17:46:24 +0000 (09:46 -0800)
Otherwise multi-omap1 configurations will fail.

Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap1/devices.c
arch/arm/mach-omap1/lcd_dma.c
arch/arm/mach-omap1/leds.c
arch/arm/mach-omap1/mcbsp.c
arch/arm/mach-omap1/pm.c
arch/arm/mach-omap1/pm_bus.c
arch/arm/mach-omap1/serial.c

index 9d97a72..dc82f3d 100644 (file)
@@ -339,6 +339,9 @@ static int __init ams_delta_modem_init(void)
 {
        int err;
 
+       if (!machine_is_ams_delta())
+               return -ENODEV;
+
        omap_cfg_reg(M14_1510_GPIO2);
        ams_delta_modem_ports[0].irq =
                        gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
index f5992c2..b2838bf 100644 (file)
@@ -83,6 +83,9 @@ static struct platform_device serial_device = {
 
 static int __init ext_uart_init(void)
 {
+       if (!machine_is_voiceblue())
+               return -ENODEV;
+
        return platform_device_register(&serial_device);
 }
 arch_initcall(ext_uart_init);
@@ -236,6 +239,9 @@ static struct notifier_block panic_block = {
 
 static int __init voiceblue_setup(void)
 {
+       if (!machine_is_voiceblue())
+               return -ENODEV;
+
        /* Setup panic notifier */
        atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
 
index 86ad38a..b0f4c23 100644 (file)
@@ -288,6 +288,9 @@ static inline void omap_init_audio(void) {}
  */
 static int __init omap1_init_devices(void)
 {
+       if (!cpu_class_is_omap1())
+               return -ENODEV;
+
        /* please keep these calls, and their implementations above,
         * in alphabetical order so they're easier to sort through.
         */
index 3be11af..c9088d8 100644 (file)
@@ -424,6 +424,9 @@ static int __init omap_init_lcd_dma(void)
 {
        int r;
 
+       if (!cpu_class_is_omap1())
+               return -ENODEV;
+
        if (cpu_is_omap16xx()) {
                u16 w;
 
index 277f356..22eb11d 100644 (file)
@@ -17,6 +17,9 @@
 static int __init
 omap_leds_init(void)
 {
+       if (!cpu_class_is_omap1())
+               return -ENODEV;
+
        if (machine_is_omap_innovator())
                leds_event = innovator_leds_event;
 
index 372ea71..8209736 100644 (file)
@@ -176,6 +176,9 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
 
 static int __init omap1_mcbsp_init(void)
 {
+       if (!cpu_class_is_omap1())
+               return -ENODEV;
+
        if (cpu_is_omap7xx()) {
                omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ;
                omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16);
index b1d3f9f..0cca23a 100644 (file)
@@ -661,6 +661,9 @@ static int __init omap_pm_init(void)
        int error;
 #endif
 
+       if (!cpu_class_is_omap1())
+               return -ENODEV;
+
        printk("Power Management for TI OMAP.\n");
 
        /*
index 8b66392..3266447 100644 (file)
@@ -73,6 +73,9 @@ static int __init omap1_pm_runtime_init(void)
        const struct dev_pm_ops *pm;
        struct dev_pm_ops *omap_pm;
 
+       if (!cpu_class_is_omap1())
+               return -ENODEV;
+
        pm = platform_bus_get_pm_ops();
        if (!pm) {
                pr_err("%s: unable to get dev_pm_ops from platform_bus\n",
index 9e1c4d4..550ca9d 100644 (file)
@@ -258,6 +258,9 @@ late_initcall(omap_serial_wakeup_init);
 
 static int __init omap_init(void)
 {
+       if (!cpu_class_is_omap1())
+               return -ENODEV;
+
        return platform_device_register(&serial_device);
 }
 arch_initcall(omap_init);