]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: OMAP: Fix i2c cmdline initcall for multiplatform
authorTony Lindgren <tony@atomide.com>
Fri, 11 Jan 2013 19:24:19 +0000 (11:24 -0800)
committerTony Lindgren <tony@atomide.com>
Fri, 11 Jan 2013 19:24:19 +0000 (11:24 -0800)
We only want this initcall to run when the kernel is
booted on omap SoCs. Fix the issue by initializing the
the initcall from separately for omap1 and omap2+.

This fixes the issue for omap2+ multiplatform configs
as we are using omap_subsys_initcall there.

Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/i2c.c
arch/arm/mach-omap2/i2c.c
arch/arm/plat-omap/i2c.c
arch/arm/plat-omap/include/plat/i2c.h

index faca808cb3d9565828123fe9ec4e94f16f2f81fe..7f5761cffd2eaf75561b3b77112b4c8553b020f4 100644 (file)
@@ -91,3 +91,9 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *pdata,
 
        return platform_device_register(pdev);
 }
+
+static  int __init omap_i2c_cmdline(void)
+{
+       return omap_register_i2c_bus_cmdline();
+}
+subsys_initcall(omap_i2c_cmdline);
index b9074dde3b9c5db7dffea856e2379e72f72aca13..8fd98576f4d34085cc2db6ce9ebd8fb6034a4886 100644 (file)
@@ -185,3 +185,8 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
        return PTR_RET(pdev);
 }
 
+static  int __init omap_i2c_cmdline(void)
+{
+       return omap_register_i2c_bus_cmdline();
+}
+omap_subsys_initcall(omap_i2c_cmdline);
index f9df624d108cf45fdd10577258ff6e4cff6b2ad1..58213d9714cd47715e7d58a818ecf976c47e226e 100644 (file)
@@ -68,7 +68,7 @@ __setup("i2c_bus=", omap_i2c_bus_setup);
  * Register busses defined in command line but that are not registered with
  * omap_register_i2c_bus from board initialization code.
  */
-static int __init omap_register_i2c_bus_cmdline(void)
+int __init omap_register_i2c_bus_cmdline(void)
 {
        int i, err = 0;
 
@@ -83,7 +83,6 @@ static int __init omap_register_i2c_bus_cmdline(void)
 out:
        return err;
 }
-subsys_initcall(omap_register_i2c_bus_cmdline);
 
 /**
  * omap_register_i2c_bus - register I2C bus with device descriptors
index 7a9028cb5a758bb3c7b96bb269e9c06d2f2930b6..810629d79668598854dc2a8e7d8326ef4f18db98 100644 (file)
@@ -32,6 +32,7 @@ int omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
 extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
                                 struct i2c_board_info const *info,
                                 unsigned len);
+extern int omap_register_i2c_bus_cmdline(void);
 #else
 static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
                                 struct i2c_board_info const *info,
@@ -39,6 +40,11 @@ static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
 {
        return 0;
 }
+
+static inline int omap_register_i2c_bus_cmdline(void)
+{
+       return 0;
+}
 #endif
 
 struct omap_hwmod;