Skip to content

Commit

Permalink
omap1: Add initcall checks for omap1 and booted board
Browse files Browse the repository at this point in the history
Otherwise multi-omap1 configurations will fail.

Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tony Lindgren committed Dec 10, 2010
1 parent df1e9d1 commit 7f9187c
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/board-ams-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/mach-omap1/board-voiceblue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/lcd_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

/*
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/pm_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-omap1/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 7f9187c

Please sign in to comment.