Skip to content

Commit

Permalink
ARM: OMAP2+: Use omap initcalls
Browse files Browse the repository at this point in the history
This way the initcalls don't run on other SoCs on multiplatform
kernels. Otherwise we'll get something like this when booting
on vexpress:

omap_hwmod: _ensure_mpu_hwmod_is_setup: MPU initiator hwmod mpu not yet registered
...
WARNING: at arch/arm/mach-omap2/pm.c:82 _init_omap_device+0x74/0x94()
_init_omap_device: could not find omap_hwmod for mpu
...
omap-dma-engine omap-dma-engine: OMAP DMA engine driver
...

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 816a65e commit b76c8b1
Show file tree
Hide file tree
Showing 31 changed files with 44 additions and 38 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-omap3beagle.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ static int __init beagle_opp_init(void)
}
return 0;
}
device_initcall(beagle_opp_init);
omap_device_initcall(beagle_opp_init);

static void __init omap3_beagle_init(void)
{
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-rx51-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <video/omapdss.h>
#include <linux/platform_data/spi-omap2-mcspi.h>

#include "soc.h"
#include "board-rx51.h"

#include "mux.h"
Expand Down Expand Up @@ -85,5 +86,5 @@ static int __init rx51_video_init(void)
return 0;
}

subsys_initcall(rx51_video_init);
omap_subsys_initcall(rx51_video_init);
#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/clock2xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ static int __init omap2xxx_clk_arch_init(void)
return ret;
}

arch_initcall(omap2xxx_clk_arch_init);
omap_arch_initcall(omap2xxx_clk_arch_init);


2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/clock3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ static int __init omap3xxx_clk_arch_init(void)
return ret;
}

arch_initcall(omap3xxx_clk_arch_init);
omap_arch_initcall(omap3xxx_clk_arch_init);


6 changes: 3 additions & 3 deletions arch/arm/mach-omap2/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int __init omap3_l3_init(void)

return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
}
postcore_initcall(omap3_l3_init);
omap_postcore_initcall(omap3_l3_init);

static int __init omap4_l3_init(void)
{
Expand Down Expand Up @@ -103,7 +103,7 @@ static int __init omap4_l3_init(void)

return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
}
postcore_initcall(omap4_l3_init);
omap_postcore_initcall(omap4_l3_init);

#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)

Expand Down Expand Up @@ -734,4 +734,4 @@ static int __init omap2_init_devices(void)

return 0;
}
arch_initcall(omap2_init_devices);
omap_arch_initcall(omap2_init_devices);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,4 @@ static int __init omap2_system_dma_init(void)
return omap_hwmod_for_each_by_class("dma",
omap2_system_dma_init_dev, NULL);
}
arch_initcall(omap2_system_dma_init);
omap_arch_initcall(omap2_system_dma_init);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ static int __init omap_init_drm(void)

}

arch_initcall(omap_init_drm);
omap_arch_initcall(omap_init_drm);

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ static int __init emu_init(void)
return 0;
}

subsys_initcall(emu_init);
omap_subsys_initcall(emu_init);
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int __init omap_init_vrfb(void)
return 0;
}

arch_initcall(omap_init_vrfb);
omap_arch_initcall(omap_init_vrfb);
#endif

#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
Expand All @@ -113,6 +113,6 @@ static int __init omap_init_fb(void)
return platform_device_register(&omap_fb_device);
}

arch_initcall(omap_init_fb);
omap_arch_initcall(omap_init_fb);

#endif
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/of.h>
#include <linux/platform_data/gpio-omap.h>

#include "soc.h"
#include "omap_hwmod.h"
#include "omap_device.h"
#include "omap-pm.h"
Expand Down Expand Up @@ -147,7 +148,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
/*
* gpio_init needs to be done before
* machine_init functions access gpio APIs.
* Hence gpio_init is a postcore_initcall.
* Hence gpio_init is a omap_postcore_initcall.
*/
static int __init omap2_gpio_init(void)
{
Expand All @@ -157,4 +158,4 @@ static int __init omap2_gpio_init(void)

return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL);
}
postcore_initcall(omap2_gpio_init);
omap_postcore_initcall(omap2_gpio_init);
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/gpmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ static __exit void gpmc_exit(void)

}

postcore_initcall(gpmc_init);
omap_postcore_initcall(gpmc_init);
module_exit(gpmc_exit);

static int __init omap_gpmc_init(void)
Expand All @@ -1225,7 +1225,7 @@ static int __init omap_gpmc_init(void)

return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
}
postcore_initcall(omap_gpmc_init);
omap_postcore_initcall(omap_gpmc_init);

static irqreturn_t gpmc_handle_irq(int irq, void *dev)
{
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/hdq1w.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/err.h>
#include <linux/platform_device.h>

#include "soc.h"
#include "omap_hwmod.h"
#include "omap_device.h"
#include "hdq1w.h"
Expand Down Expand Up @@ -93,4 +94,4 @@ static int __init omap_init_hdq(void)

return 0;
}
arch_initcall(omap_init_hdq);
omap_arch_initcall(omap_init_hdq);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/hwspinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ static int __init hwspinlocks_init(void)
return retval;
}
/* early board code might need to reserve specific hwspinlock instances */
postcore_initcall(hwspinlocks_init);
omap_postcore_initcall(hwspinlocks_init);
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <linux/omap-dma.h>

#include "soc.h"
#include "omap_device.h"

/*
Expand Down Expand Up @@ -118,4 +119,4 @@ static int __init omap2_mcbsp_init(void)

return 0;
}
arch_initcall(omap2_mcbsp_init);
omap_arch_initcall(omap2_mcbsp_init);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int __init omap_iommu_init(void)
return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL);
}
/* must be ready before omap3isp is probed */
subsys_initcall(omap_iommu_init);
omap_subsys_initcall(omap_iommu_init);

static void __exit omap_iommu_exit(void)
{
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/omap2-restart.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/clk.h>
#include <linux/io.h>

#include "soc.h"
#include "common.h"
#include "prm2xxx.h"

Expand Down Expand Up @@ -62,4 +63,4 @@ static int __init omap2xxx_common_look_up_clks_for_reset(void)

return 0;
}
core_initcall(omap2xxx_common_look_up_clks_for_reset);
omap_core_initcall(omap2xxx_common_look_up_clks_for_reset);
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/omap4-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int __init omap_l2_cache_init(void)

return 0;
}
early_initcall(omap_l2_cache_init);
omap_early_initcall(omap_l2_cache_init);
#endif

void __iomem *omap4_get_sar_ram_base(void)
Expand Down Expand Up @@ -253,7 +253,7 @@ static int __init omap4_sar_ram_init(void)

return 0;
}
early_initcall(omap4_sar_ram_init);
omap_early_initcall(omap4_sar_ram_init);

static struct of_device_id irq_match[] __initdata = {
{ .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/omap_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#include <linux/of.h>
#include <linux/notifier.h>

#include "soc.h"
#include "omap_device.h"
#include "omap_hwmod.h"

Expand Down Expand Up @@ -1259,7 +1260,7 @@ static int __init omap_device_init(void)
bus_register_notifier(&platform_bus_type, &platform_nb);
return 0;
}
core_initcall(omap_device_init);
omap_core_initcall(omap_device_init);

/**
* omap_device_late_idle - idle devices without drivers
Expand Down Expand Up @@ -1297,4 +1298,4 @@ static int __init omap_device_late_init(void)
bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
return 0;
}
late_initcall(omap_device_late_init);
omap_late_initcall(omap_device_late_init);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -3303,7 +3303,7 @@ static int __init omap_hwmod_setup_all(void)

return 0;
}
core_initcall(omap_hwmod_setup_all);
omap_core_initcall(omap_hwmod_setup_all);

/**
* omap_hwmod_enable - enable an omap_hwmod
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_phy_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static int __init omap4430_phy_power_down(void)

return 0;
}
early_initcall(omap4430_phy_power_down);
omap_early_initcall(omap4430_phy_power_down);

void am35x_musb_reset(void)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/opp3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ int __init omap3_opp_init(void)

return r;
}
device_initcall(omap3_opp_init);
omap_device_initcall(omap3_opp_init);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/opp4xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ int __init omap4_opp_init(void)
ARRAY_SIZE(omap446x_opp_def_list));
return r;
}
device_initcall(omap4_opp_init);
omap_device_initcall(omap4_opp_init);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/pm-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,6 @@ static int __init pm_dbg_init(void)

return 0;
}
arch_initcall(pm_dbg_init);
omap_arch_initcall(pm_dbg_init);

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ static int __init omap2_common_pm_init(void)

return 0;
}
postcore_initcall(omap2_common_pm_init);
omap_postcore_initcall(omap2_common_pm_init);

int __init omap2_common_pm_late_init(void)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ static int __init omap_init_pmu(void)

return omap2_init_pmu(oh_num, oh_names);
}
subsys_initcall(omap_init_pmu);
omap_subsys_initcall(omap_init_pmu);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/prm3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int __init omap3xxx_prm_late_init(void)

return ret;
}
subsys_initcall(omap3xxx_prm_late_init);
omap_subsys_initcall(omap3xxx_prm_late_init);

static void __exit omap3xxx_prm_exit(void)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/prm44xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ static int __init omap44xx_prm_late_init(void)

return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
}
subsys_initcall(omap44xx_prm_late_init);
omap_subsys_initcall(omap44xx_prm_late_init);

static void __exit omap44xx_prm_exit(void)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static int __init omap_serial_early_init(void)

return 0;
}
core_initcall(omap_serial_early_init);
omap_core_initcall(omap_serial_early_init);

/**
* omap_serial_init_port() - initialize single serial port
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/smartreflex-class3.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ static int __init sr_class3_init(void)
pr_info("SmartReflex Class3 initialized\n");
return sr_register_class(&class3_data);
}
late_initcall(sr_class3_init);
omap_late_initcall(sr_class3_init);
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ static int __init omap2_dm_timer_init(void)

return 0;
}
arch_initcall(omap2_dm_timer_init);
omap_arch_initcall(omap2_dm_timer_init);

/**
* omap2_override_clocksource - clocksource override with user configuration
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/wd_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ static int __init omap_init_wdt(void)
dev_name, oh->name);
return 0;
}
subsys_initcall(omap_init_wdt);
omap_subsys_initcall(omap_init_wdt);

0 comments on commit b76c8b1

Please sign in to comment.