Skip to content

Commit

Permalink
ARM: OMAP: Fix i2c cmdline initcall for multiplatform
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tony Lindgren committed Jan 11, 2013
1 parent b76c8b1 commit a6cf912
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions arch/arm/mach-omap1/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
5 changes: 5 additions & 0 deletions arch/arm/mach-omap2/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
3 changes: 1 addition & 2 deletions arch/arm/plat-omap/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/plat-omap/include/plat/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ 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,
unsigned len)
{
return 0;
}

static inline int omap_register_i2c_bus_cmdline(void)
{
return 0;
}
#endif

struct omap_hwmod;
Expand Down

0 comments on commit a6cf912

Please sign in to comment.