diff options
author | Kevin Hilman <khilman@ti.com> | 2012-02-20 12:43:30 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-02-24 16:04:10 -0500 |
commit | 9cf793f9b8b1ba9414e2a7591b2e911885f85a27 (patch) | |
tree | 7ac9494904f303d04d00d6d8cc0aa65e2d77115d /arch/arm | |
parent | d1589f0912533e6cb2ac8fd6f1feb3d5989fe8cb (diff) |
ARM: OMAP: convert omap_device_build() and callers to __init
Building omap_devices should only be done at init time, and since
omap_device_build() is using early_platform calls which are also
__init, this ensures that omap_device isn't trying to use functions
that disappear.
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/gpio.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/mcbsp.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sr_device.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 7 |
6 files changed, 12 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 283d11eae693..01cffcea936a 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -276,7 +276,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data | |||
276 | } | 276 | } |
277 | 277 | ||
278 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) | 278 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) |
279 | static inline void omap_init_mbox(void) | 279 | static inline void __init omap_init_mbox(void) |
280 | { | 280 | { |
281 | struct omap_hwmod *oh; | 281 | struct omap_hwmod *oh; |
282 | struct platform_device *pdev; | 282 | struct platform_device *pdev; |
@@ -337,7 +337,7 @@ static inline void omap_init_audio(void) {} | |||
337 | #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ | 337 | #if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \ |
338 | defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) | 338 | defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE) |
339 | 339 | ||
340 | static void omap_init_mcpdm(void) | 340 | static void __init omap_init_mcpdm(void) |
341 | { | 341 | { |
342 | struct omap_hwmod *oh; | 342 | struct omap_hwmod *oh; |
343 | struct platform_device *pdev; | 343 | struct platform_device *pdev; |
@@ -358,7 +358,7 @@ static inline void omap_init_mcpdm(void) {} | |||
358 | #if defined(CONFIG_SND_OMAP_SOC_DMIC) || \ | 358 | #if defined(CONFIG_SND_OMAP_SOC_DMIC) || \ |
359 | defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE) | 359 | defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE) |
360 | 360 | ||
361 | static void omap_init_dmic(void) | 361 | static void __init omap_init_dmic(void) |
362 | { | 362 | { |
363 | struct omap_hwmod *oh; | 363 | struct omap_hwmod *oh; |
364 | struct platform_device *pdev; | 364 | struct platform_device *pdev; |
@@ -380,7 +380,7 @@ static inline void omap_init_dmic(void) {} | |||
380 | 380 | ||
381 | #include <plat/mcspi.h> | 381 | #include <plat/mcspi.h> |
382 | 382 | ||
383 | static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) | 383 | static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused) |
384 | { | 384 | { |
385 | struct platform_device *pdev; | 385 | struct platform_device *pdev; |
386 | char *name = "omap2_mcspi"; | 386 | char *name = "omap2_mcspi"; |
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c index 8cbfbc2918ce..64c0caed9516 100644 --- a/arch/arm/mach-omap2/gpio.c +++ b/arch/arm/mach-omap2/gpio.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <plat/omap_hwmod.h> | 24 | #include <plat/omap_hwmod.h> |
25 | #include <plat/omap_device.h> | 25 | #include <plat/omap_device.h> |
26 | 26 | ||
27 | static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) | 27 | static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) |
28 | { | 28 | { |
29 | struct platform_device *pdev; | 29 | struct platform_device *pdev; |
30 | struct omap_gpio_platform_data *pdata; | 30 | struct omap_gpio_platform_data *pdata; |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index fb4bcf81a183..5f8a876e4fd2 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -122,7 +122,7 @@ static int omap3_enable_st_clock(unsigned int id, bool enable) | |||
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||
125 | static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) | 125 | static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused) |
126 | { | 126 | { |
127 | int id, count = 1; | 127 | int id, count = 1; |
128 | char *name = "omap-mcbsp"; | 128 | char *name = "omap-mcbsp"; |
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 1881fe915149..fb9b85bfc308 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | static struct omap_device_pm_latency *pm_lats; | 29 | static struct omap_device_pm_latency *pm_lats; |
30 | 30 | ||
31 | static int _init_omap_device(char *name) | 31 | static int __init _init_omap_device(char *name) |
32 | { | 32 | { |
33 | struct omap_hwmod *oh; | 33 | struct omap_hwmod *oh; |
34 | struct platform_device *pdev; | 34 | struct platform_device *pdev; |
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index 9f43fcc05d3e..78c9437913ce 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c | |||
@@ -69,7 +69,7 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data, | |||
69 | sr_data->nvalue_count = count; | 69 | sr_data->nvalue_count = count; |
70 | } | 70 | } |
71 | 71 | ||
72 | static int sr_dev_init(struct omap_hwmod *oh, void *user) | 72 | static int __init sr_dev_init(struct omap_hwmod *oh, void *user) |
73 | { | 73 | { |
74 | struct omap_sr_data *sr_data; | 74 | struct omap_sr_data *sr_data; |
75 | struct platform_device *pdev; | 75 | struct platform_device *pdev; |
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index f72fafc9e9f4..2d00ab01d150 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -1,3 +1,4 @@ | |||
1 | |||
1 | /* | 2 | /* |
2 | * omap_device implementation | 3 | * omap_device implementation |
3 | * | 4 | * |
@@ -612,7 +613,7 @@ void omap_device_delete(struct omap_device *od) | |||
612 | * information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise, | 613 | * information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise, |
613 | * passes along the return value of omap_device_build_ss(). | 614 | * passes along the return value of omap_device_build_ss(). |
614 | */ | 615 | */ |
615 | struct platform_device *omap_device_build(const char *pdev_name, int pdev_id, | 616 | struct platform_device __init *omap_device_build(const char *pdev_name, int pdev_id, |
616 | struct omap_hwmod *oh, void *pdata, | 617 | struct omap_hwmod *oh, void *pdata, |
617 | int pdata_len, | 618 | int pdata_len, |
618 | struct omap_device_pm_latency *pm_lats, | 619 | struct omap_device_pm_latency *pm_lats, |
@@ -645,7 +646,7 @@ struct platform_device *omap_device_build(const char *pdev_name, int pdev_id, | |||
645 | * platform_device record. Returns an ERR_PTR() on error, or passes | 646 | * platform_device record. Returns an ERR_PTR() on error, or passes |
646 | * along the return value of omap_device_register(). | 647 | * along the return value of omap_device_register(). |
647 | */ | 648 | */ |
648 | struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, | 649 | struct platform_device __init *omap_device_build_ss(const char *pdev_name, int pdev_id, |
649 | struct omap_hwmod **ohs, int oh_cnt, | 650 | struct omap_hwmod **ohs, int oh_cnt, |
650 | void *pdata, int pdata_len, | 651 | void *pdata, int pdata_len, |
651 | struct omap_device_pm_latency *pm_lats, | 652 | struct omap_device_pm_latency *pm_lats, |
@@ -710,7 +711,7 @@ odbs_exit: | |||
710 | * platform_early_add_device() on the underlying platform_device. | 711 | * platform_early_add_device() on the underlying platform_device. |
711 | * Returns 0 by default. | 712 | * Returns 0 by default. |
712 | */ | 713 | */ |
713 | static int omap_early_device_register(struct platform_device *pdev) | 714 | static int __init omap_early_device_register(struct platform_device *pdev) |
714 | { | 715 | { |
715 | struct platform_device *devices[1]; | 716 | struct platform_device *devices[1]; |
716 | 717 | ||