ARM: OMAP2+: Mark omap_hsmmc_init and omap_mux related functions as __init

Now that omap hsmmc init is split into two functions, it's safe
to mark omap_hsmmc_init and omap_mux related functions to __init.

This basically reverts the following fixes for the case where
TWL was compiled as a module:

a98f77b (ARM: omap: fix section mismatch warning for sdp3430_twl_gpio_setup())
8930b4e (ARM: omap: fix section mismatch warnings in mux.c caused by hsmmc.c)

Additionally it fixes up the remaining section warnings for
all callers of omap_mux functions.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
Tony Lindgren 2012-02-20 09:43:30 -08:00
parent 3b972bf06c
commit d1589f0912
9 changed files with 32 additions and 27 deletions

View File

@ -189,7 +189,7 @@ unmap:
* *
* @return - void. * @return - void.
*/ */
void board_flash_init(struct flash_partitions partition_info[], void __init board_flash_init(struct flash_partitions partition_info[],
char chip_sel_board[][GPMC_CS_NUM], int nand_type) char chip_sel_board[][GPMC_CS_NUM], int nand_type)
{ {
u8 cs = 0; u8 cs = 0;

View File

@ -273,8 +273,6 @@ static int beagle_twl_gpio_setup(struct device *dev,
{ {
int r; int r;
if (beagle_config.mmc1_gpio_wp != -EINVAL)
omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT);
mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp; mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp;
/* gpio + 0 is "mmc0_cd" (input/IRQ) */ /* gpio + 0 is "mmc0_cd" (input/IRQ) */
mmc[0].gpio_cd = gpio + 0; mmc[0].gpio_cd = gpio + 0;
@ -522,7 +520,11 @@ static void __init omap3_beagle_init(void)
{ {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap3_beagle_init_rev(); omap3_beagle_init_rev();
if (beagle_config.mmc1_gpio_wp != -EINVAL)
omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT);
omap_hsmmc_init(mmc); omap_hsmmc_init(mmc);
omap3_beagle_i2c_init(); omap3_beagle_i2c_init();
gpio_buttons[0].gpio = beagle_config.usr_button_gpio; gpio_buttons[0].gpio = beagle_config.usr_button_gpio;

View File

@ -362,7 +362,6 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
int r, lcd_bl_en; int r, lcd_bl_en;
/* gpio + 0 is "mmc0_cd" (input/IRQ) */ /* gpio + 0 is "mmc0_cd" (input/IRQ) */
omap_mux_init_gpio(63, OMAP_PIN_INPUT);
mmc[0].gpio_cd = gpio + 0; mmc[0].gpio_cd = gpio + 0;
omap_hsmmc_late_init(mmc); omap_hsmmc_late_init(mmc);
@ -645,7 +644,9 @@ static void __init omap3_evm_init(void)
omap_board_config = omap3_evm_config; omap_board_config = omap3_evm_config;
omap_board_config_size = ARRAY_SIZE(omap3_evm_config); omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
omap_mux_init_gpio(63, OMAP_PIN_INPUT);
omap_hsmmc_init(mmc); omap_hsmmc_init(mmc);
omap3_evm_i2c_init(); omap3_evm_i2c_init();
omap_display_init(&omap3_evm_dss_data); omap_display_init(&omap3_evm_dss_data);

View File

@ -283,7 +283,6 @@ omap3stalker_twl_gpio_setup(struct device *dev,
unsigned gpio, unsigned ngpio) unsigned gpio, unsigned ngpio)
{ {
/* gpio + 0 is "mmc0_cd" (input/IRQ) */ /* gpio + 0 is "mmc0_cd" (input/IRQ) */
omap_mux_init_gpio(23, OMAP_PIN_INPUT);
mmc[0].gpio_cd = gpio + 0; mmc[0].gpio_cd = gpio + 0;
omap_hsmmc_late_init(mmc); omap_hsmmc_late_init(mmc);
@ -426,7 +425,9 @@ static void __init omap3_stalker_init(void)
omap_board_config = omap3_stalker_config; omap_board_config = omap3_stalker_config;
omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
omap_mux_init_gpio(23, OMAP_PIN_INPUT);
omap_hsmmc_init(mmc); omap_hsmmc_init(mmc);
omap3_stalker_i2c_init(); omap3_stalker_i2c_init();
platform_add_devices(omap3_stalker_devices, platform_add_devices(omap3_stalker_devices,

View File

@ -118,12 +118,6 @@ static struct gpio_led gpio_leds[];
static int touchbook_twl_gpio_setup(struct device *dev, static int touchbook_twl_gpio_setup(struct device *dev,
unsigned gpio, unsigned ngpio) unsigned gpio, unsigned ngpio)
{ {
if (system_rev >= 0x20 && system_rev <= 0x34301000) {
omap_mux_init_gpio(23, OMAP_PIN_INPUT);
mmc[0].gpio_wp = 23;
} else {
omap_mux_init_gpio(29, OMAP_PIN_INPUT);
}
/* gpio + 0 is "mmc0_cd" (input/IRQ) */ /* gpio + 0 is "mmc0_cd" (input/IRQ) */
mmc[0].gpio_cd = gpio + 0; mmc[0].gpio_cd = gpio + 0;
omap_hsmmc_late_init(mmc); omap_hsmmc_late_init(mmc);
@ -352,7 +346,14 @@ static void __init omap3_touchbook_init(void)
pm_power_off = omap3_touchbook_poweroff; pm_power_off = omap3_touchbook_poweroff;
if (system_rev >= 0x20 && system_rev <= 0x34301000) {
omap_mux_init_gpio(23, OMAP_PIN_INPUT);
mmc[0].gpio_wp = 23;
} else {
omap_mux_init_gpio(29, OMAP_PIN_INPUT);
}
omap_hsmmc_init(mmc); omap_hsmmc_init(mmc);
omap3_touchbook_i2c_init(); omap3_touchbook_i2c_init();
platform_add_devices(omap3_touchbook_devices, platform_add_devices(omap3_touchbook_devices,
ARRAY_SIZE(omap3_touchbook_devices)); ARRAY_SIZE(omap3_touchbook_devices));

View File

@ -461,7 +461,7 @@ static struct omap_dss_board_info omap4_panda_dss_data = {
.default_device = &omap4_panda_dvi_device, .default_device = &omap4_panda_dvi_device,
}; };
void omap4_panda_display_init(void) void __init omap4_panda_display_init(void)
{ {
int r; int r;

View File

@ -124,7 +124,7 @@ static void omap4_hdmi_mux_pads(enum omap_hdmi_flags flags)
} }
} }
static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) static int __init omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
{ {
u32 enable_mask, enable_shift; u32 enable_mask, enable_shift;
u32 pipd_mask, pipd_shift; u32 pipd_mask, pipd_shift;
@ -157,7 +157,7 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
return 0; return 0;
} }
int omap_hdmi_init(enum omap_hdmi_flags flags) int __init omap_hdmi_init(enum omap_hdmi_flags flags)
{ {
if (cpu_is_omap44xx()) if (cpu_is_omap44xx())
omap4_hdmi_mux_pads(flags); omap4_hdmi_mux_pads(flags);
@ -165,7 +165,7 @@ int omap_hdmi_init(enum omap_hdmi_flags flags)
return 0; return 0;
} }
static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) static int __init omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
{ {
if (cpu_is_omap44xx()) if (cpu_is_omap44xx())
return omap4_dsi_mux_pads(dsi_id, lane_mask); return omap4_dsi_mux_pads(dsi_id, lane_mask);
@ -173,7 +173,7 @@ static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
return 0; return 0;
} }
static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) static void __init omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
{ {
if (cpu_is_omap44xx()) if (cpu_is_omap44xx())
omap4_dsi_mux_pads(dsi_id, 0); omap4_dsi_mux_pads(dsi_id, 0);

View File

@ -293,8 +293,8 @@ static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
} }
} }
static int omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
struct omap_mmc_platform_data *mmc) struct omap_mmc_platform_data *mmc)
{ {
char *hc_name; char *hc_name;
@ -553,7 +553,7 @@ free_mmc:
kfree(mmc_data); kfree(mmc_data);
} }
void omap_hsmmc_init(struct omap2_hsmmc_info *controllers) void __init omap_hsmmc_init(struct omap2_hsmmc_info *controllers)
{ {
u32 reg; u32 reg;

View File

@ -100,8 +100,8 @@ void omap_mux_write_array(struct omap_mux_partition *partition,
static char *omap_mux_options; static char *omap_mux_options;
static int _omap_mux_init_gpio(struct omap_mux_partition *partition, static int __init _omap_mux_init_gpio(struct omap_mux_partition *partition,
int gpio, int val) int gpio, int val)
{ {
struct omap_mux_entry *e; struct omap_mux_entry *e;
struct omap_mux *gpio_mux = NULL; struct omap_mux *gpio_mux = NULL;
@ -145,7 +145,7 @@ static int _omap_mux_init_gpio(struct omap_mux_partition *partition,
return 0; return 0;
} }
int omap_mux_init_gpio(int gpio, int val) int __init omap_mux_init_gpio(int gpio, int val)
{ {
struct omap_mux_partition *partition; struct omap_mux_partition *partition;
int ret; int ret;
@ -159,9 +159,9 @@ int omap_mux_init_gpio(int gpio, int val)
return -ENODEV; return -ENODEV;
} }
static int _omap_mux_get_by_name(struct omap_mux_partition *partition, static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition,
const char *muxname, const char *muxname,
struct omap_mux **found_mux) struct omap_mux **found_mux)
{ {
struct omap_mux *mux = NULL; struct omap_mux *mux = NULL;
struct omap_mux_entry *e; struct omap_mux_entry *e;
@ -218,7 +218,7 @@ static int _omap_mux_get_by_name(struct omap_mux_partition *partition,
return -ENODEV; return -ENODEV;
} }
static int static int __init
omap_mux_get_by_name(const char *muxname, omap_mux_get_by_name(const char *muxname,
struct omap_mux_partition **found_partition, struct omap_mux_partition **found_partition,
struct omap_mux **found_mux) struct omap_mux **found_mux)
@ -240,7 +240,7 @@ omap_mux_get_by_name(const char *muxname,
return -ENODEV; return -ENODEV;
} }
int omap_mux_init_signal(const char *muxname, int val) int __init omap_mux_init_signal(const char *muxname, int val)
{ {
struct omap_mux_partition *partition = NULL; struct omap_mux_partition *partition = NULL;
struct omap_mux *mux = NULL; struct omap_mux *mux = NULL;