ARM: ux500: Only initialise STE's UIBs on boards which support them
authorLee Jones <lee.jones@linaro.org>
Wed, 2 May 2012 08:53:48 +0000 (09:53 +0100)
committerArnd Bergmann <arnd@arndb.de>
Fri, 1 Jun 2012 00:04:33 +0000 (02:04 +0200)
ST-Ericsson uses User Interface Boards to extend functionality of
some of their development boards. However, these aren't compatible
with all the supported boards found in Mainline (Snowball for
instance). This patch ensures that the UIBs are only probed on
boards which can actually support them. This in turn saves lots of
unnecessary error messages normally found in Snowball's boot log.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-ux500/board-mop500-uib.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/board-mop500.h

index b29a788f498cbcd93e96f7c21329785bab4dd094..1f47d962e3a12f6212a7e9450075bd94e3a49193 100644 (file)
@@ -96,7 +96,7 @@ static void __init __mop500_uib_init(struct uib *uib, const char *why)
 /*
  * Detect the UIB attached based on the presence or absence of i2c devices.
  */
-static int __init mop500_uib_init(void)
+int __init mop500_uib_init(void)
 {
        struct uib *uib = mop500_uib;
        struct i2c_adapter *i2c0;
@@ -131,5 +131,3 @@ static int __init mop500_uib_init(void)
 
        return 0;
 }
-
-module_init(mop500_uib_init);
index 5c5bfd5d1b11dadebb0edf18c184a8ec8cae1745..c3ece275b22c9035784f34fbab4cfc899be26f99 100644 (file)
@@ -716,6 +716,8 @@ static void __init mop500_init_machine(void)
 
        /* This board has full regulator constraints */
        regulator_has_full_constraints();
+
+       mop500_uib_init();
 }
 
 static void __init snowball_init_machine(void)
@@ -780,6 +782,8 @@ static void __init hrefv60_init_machine(void)
 
        /* This board has full regulator constraints */
        regulator_has_full_constraints();
+
+       mop500_uib_init();
 }
 
 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
@@ -883,6 +887,8 @@ static void __init u8500_init_machine(void)
                i2c_register_board_info(2, mop500_i2c2_devices,
                                        ARRAY_SIZE(mop500_i2c2_devices));
 
+               mop500_uib_init();
+
        } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
                /*
                 * Devices to be DT:ed:
@@ -913,6 +919,8 @@ static void __init u8500_init_machine(void)
                i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
                i2c_register_board_info(2, mop500_i2c2_devices,
                                        ARRAY_SIZE(mop500_i2c2_devices));
+
+               mop500_uib_init();
        }
        mop500_i2c_init(parent);
 
index 3be0cb8f8914df84968fd9db31a1a1ae50309d6d..2f87b25a908a31c74264ac0b7a29eb34f85f2c58 100644 (file)
@@ -89,6 +89,7 @@ void __init mop500_pinmaps_init(void);
 void __init snowball_pinmaps_init(void);
 void __init hrefv60_pinmaps_init(void);
 
+int __init mop500_uib_init(void);
 void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
                unsigned n);