ARM: tegra: Fix board-specific initcalls
Dan Willemsen [Mon, 24 Oct 2011 21:32:09 +0000 (14:32 -0700)]
These initcalls weren't ensuring that they're actually running on the
board they care about, which breaks on a multi-board kernel.

Change-Id: Ifd8a3e523c2523b68ec4d7e30c2b87969b939931
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Reviewed-on: http://git-master/r/60010
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: Rf189bc5a0510612b55504b3412f01cf8470038d0

arch/arm/mach-tegra/board-cardhu-power.c
arch/arm/mach-tegra/board-cardhu-sensors.c

index c35b7e1..82b627e 100644 (file)
@@ -30,6 +30,8 @@
 #include <linux/regulator/tps6236x-regulator.h>
 #include <linux/power/gpio-charger.h>
 
+#include <asm/mach-types.h>
+
 #include <mach/iomap.h>
 #include <mach/irqs.h>
 #include <mach/pinmux.h>
@@ -1092,6 +1094,9 @@ static struct platform_device cardhu_charger_device = {
 
 static int __init cardhu_charger_late_init(void)
 {
+       if (!machine_is_cardhu())
+               return 0;
+
        platform_device_register(&cardhu_charger_device);
        return 0;
 }
index 16075e6..9f987c2 100644 (file)
@@ -916,6 +916,9 @@ int __init cardhu_ov5650_late_init(void)
        int ret;
        int i;
 
+       if (!machine_is_cardhu())
+               return 0;
+
        if ((board_info.board_id == BOARD_E1198) ||
                (board_info.board_id == BOARD_E1291))
                return 0;