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>
This commit is contained in:
parent
d1589f0912
commit
9cf793f9b8
6 changed files with 12 additions and 11 deletions
|
@ -276,7 +276,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
|
#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
|
||||||
static inline void omap_init_mbox(void)
|
static inline void __init omap_init_mbox(void)
|
||||||
{
|
{
|
||||||
struct omap_hwmod *oh;
|
struct omap_hwmod *oh;
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
|
@ -337,7 +337,7 @@ static inline void omap_init_audio(void) {}
|
||||||
#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
|
#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
|
||||||
defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
|
defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
|
||||||
|
|
||||||
static void omap_init_mcpdm(void)
|
static void __init omap_init_mcpdm(void)
|
||||||
{
|
{
|
||||||
struct omap_hwmod *oh;
|
struct omap_hwmod *oh;
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
|
@ -358,7 +358,7 @@ static inline void omap_init_mcpdm(void) {}
|
||||||
#if defined(CONFIG_SND_OMAP_SOC_DMIC) || \
|
#if defined(CONFIG_SND_OMAP_SOC_DMIC) || \
|
||||||
defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE)
|
defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE)
|
||||||
|
|
||||||
static void omap_init_dmic(void)
|
static void __init omap_init_dmic(void)
|
||||||
{
|
{
|
||||||
struct omap_hwmod *oh;
|
struct omap_hwmod *oh;
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
|
@ -380,7 +380,7 @@ static inline void omap_init_dmic(void) {}
|
||||||
|
|
||||||
#include <plat/mcspi.h>
|
#include <plat/mcspi.h>
|
||||||
|
|
||||||
static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
|
static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
char *name = "omap2_mcspi";
|
char *name = "omap2_mcspi";
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <plat/omap_hwmod.h>
|
#include <plat/omap_hwmod.h>
|
||||||
#include <plat/omap_device.h>
|
#include <plat/omap_device.h>
|
||||||
|
|
||||||
static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
|
static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
struct omap_gpio_platform_data *pdata;
|
struct omap_gpio_platform_data *pdata;
|
||||||
|
|
|
@ -122,7 +122,7 @@ static int omap3_enable_st_clock(unsigned int id, bool enable)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
|
static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
|
||||||
{
|
{
|
||||||
int id, count = 1;
|
int id, count = 1;
|
||||||
char *name = "omap-mcbsp";
|
char *name = "omap-mcbsp";
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
static struct omap_device_pm_latency *pm_lats;
|
static struct omap_device_pm_latency *pm_lats;
|
||||||
|
|
||||||
static int _init_omap_device(char *name)
|
static int __init _init_omap_device(char *name)
|
||||||
{
|
{
|
||||||
struct omap_hwmod *oh;
|
struct omap_hwmod *oh;
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
|
|
|
@ -69,7 +69,7 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
|
||||||
sr_data->nvalue_count = count;
|
sr_data->nvalue_count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sr_dev_init(struct omap_hwmod *oh, void *user)
|
static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
|
||||||
{
|
{
|
||||||
struct omap_sr_data *sr_data;
|
struct omap_sr_data *sr_data;
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* omap_device implementation
|
* omap_device implementation
|
||||||
*
|
*
|
||||||
|
@ -612,7 +613,7 @@ void omap_device_delete(struct omap_device *od)
|
||||||
* information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
|
* information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
|
||||||
* passes along the return value of omap_device_build_ss().
|
* passes along the return value of omap_device_build_ss().
|
||||||
*/
|
*/
|
||||||
struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
|
struct platform_device __init *omap_device_build(const char *pdev_name, int pdev_id,
|
||||||
struct omap_hwmod *oh, void *pdata,
|
struct omap_hwmod *oh, void *pdata,
|
||||||
int pdata_len,
|
int pdata_len,
|
||||||
struct omap_device_pm_latency *pm_lats,
|
struct omap_device_pm_latency *pm_lats,
|
||||||
|
@ -645,7 +646,7 @@ struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
|
||||||
* platform_device record. Returns an ERR_PTR() on error, or passes
|
* platform_device record. Returns an ERR_PTR() on error, or passes
|
||||||
* along the return value of omap_device_register().
|
* along the return value of omap_device_register().
|
||||||
*/
|
*/
|
||||||
struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
|
struct platform_device __init *omap_device_build_ss(const char *pdev_name, int pdev_id,
|
||||||
struct omap_hwmod **ohs, int oh_cnt,
|
struct omap_hwmod **ohs, int oh_cnt,
|
||||||
void *pdata, int pdata_len,
|
void *pdata, int pdata_len,
|
||||||
struct omap_device_pm_latency *pm_lats,
|
struct omap_device_pm_latency *pm_lats,
|
||||||
|
@ -710,7 +711,7 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
|
||||||
* platform_early_add_device() on the underlying platform_device.
|
* platform_early_add_device() on the underlying platform_device.
|
||||||
* Returns 0 by default.
|
* Returns 0 by default.
|
||||||
*/
|
*/
|
||||||
static int omap_early_device_register(struct platform_device *pdev)
|
static int __init omap_early_device_register(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct platform_device *devices[1];
|
struct platform_device *devices[1];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue