Skip to content

Commit

Permalink
ARM: OMAP2+: Mark omap_hsmmc_init and omap_mux related functions as _…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
Tony Lindgren committed Feb 24, 2012
1 parent 3b972bf commit d1589f0
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static u8 get_gpmc0_type(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)
{
u8 cs = 0;
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-omap2/board-omap3beagle.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ static int beagle_twl_gpio_setup(struct device *dev,
{
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;
/* gpio + 0 is "mmc0_cd" (input/IRQ) */
mmc[0].gpio_cd = gpio + 0;
Expand Down Expand Up @@ -522,7 +520,11 @@ static void __init omap3_beagle_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
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);

omap3_beagle_i2c_init();

gpio_buttons[0].gpio = beagle_config.usr_button_gpio;
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-omap3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
int r, lcd_bl_en;

/* gpio + 0 is "mmc0_cd" (input/IRQ) */
omap_mux_init_gpio(63, OMAP_PIN_INPUT);
mmc[0].gpio_cd = gpio + 0;
omap_hsmmc_late_init(mmc);

Expand Down Expand Up @@ -645,7 +644,9 @@ static void __init omap3_evm_init(void)
omap_board_config = omap3_evm_config;
omap_board_config_size = ARRAY_SIZE(omap3_evm_config);

omap_mux_init_gpio(63, OMAP_PIN_INPUT);
omap_hsmmc_init(mmc);

omap3_evm_i2c_init();

omap_display_init(&omap3_evm_dss_data);
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/board-omap3stalker.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ omap3stalker_twl_gpio_setup(struct device *dev,
unsigned gpio, unsigned ngpio)
{
/* gpio + 0 is "mmc0_cd" (input/IRQ) */
omap_mux_init_gpio(23, OMAP_PIN_INPUT);
mmc[0].gpio_cd = gpio + 0;
omap_hsmmc_late_init(mmc);

Expand Down Expand Up @@ -426,7 +425,9 @@ static void __init omap3_stalker_init(void)
omap_board_config = omap3_stalker_config;
omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);

omap_mux_init_gpio(23, OMAP_PIN_INPUT);
omap_hsmmc_init(mmc);

omap3_stalker_i2c_init();

platform_add_devices(omap3_stalker_devices,
Expand Down
13 changes: 7 additions & 6 deletions arch/arm/mach-omap2/board-omap3touchbook.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ static struct gpio_led gpio_leds[];
static int touchbook_twl_gpio_setup(struct device *dev,
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) */
mmc[0].gpio_cd = gpio + 0;
omap_hsmmc_late_init(mmc);
Expand Down Expand Up @@ -352,7 +346,14 @@ static void __init omap3_touchbook_init(void)

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);

omap3_touchbook_i2c_init();
platform_add_devices(omap3_touchbook_devices,
ARRAY_SIZE(omap3_touchbook_devices));
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-omap4panda.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static struct omap_dss_board_info omap4_panda_dss_data = {
.default_device = &omap4_panda_dvi_device,
};

void omap4_panda_display_init(void)
void __init omap4_panda_display_init(void)
{
int r;

Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-omap2/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 pipd_mask, pipd_shift;
Expand Down Expand Up @@ -157,23 +157,23 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
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())
omap4_hdmi_mux_pads(flags);

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())
return omap4_dsi_mux_pads(dsi_id, lane_mask);

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())
omap4_dsi_mux_pads(dsi_id, 0);
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-omap2/hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
struct omap_mmc_platform_data *mmc)
static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
struct omap_mmc_platform_data *mmc)
{
char *hc_name;

Expand Down Expand Up @@ -553,7 +553,7 @@ static void omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
kfree(mmc_data);
}

void omap_hsmmc_init(struct omap2_hsmmc_info *controllers)
void __init omap_hsmmc_init(struct omap2_hsmmc_info *controllers)
{
u32 reg;

Expand Down
16 changes: 8 additions & 8 deletions arch/arm/mach-omap2/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ void omap_mux_write_array(struct omap_mux_partition *partition,

static char *omap_mux_options;

static int _omap_mux_init_gpio(struct omap_mux_partition *partition,
int gpio, int val)
static int __init _omap_mux_init_gpio(struct omap_mux_partition *partition,
int gpio, int val)
{
struct omap_mux_entry *e;
struct omap_mux *gpio_mux = NULL;
Expand Down Expand Up @@ -145,7 +145,7 @@ static int _omap_mux_init_gpio(struct omap_mux_partition *partition,
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;
int ret;
Expand All @@ -159,9 +159,9 @@ int omap_mux_init_gpio(int gpio, int val)
return -ENODEV;
}

static int _omap_mux_get_by_name(struct omap_mux_partition *partition,
const char *muxname,
struct omap_mux **found_mux)
static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition,
const char *muxname,
struct omap_mux **found_mux)
{
struct omap_mux *mux = NULL;
struct omap_mux_entry *e;
Expand Down Expand Up @@ -218,7 +218,7 @@ static int _omap_mux_get_by_name(struct omap_mux_partition *partition,
return -ENODEV;
}

static int
static int __init
omap_mux_get_by_name(const char *muxname,
struct omap_mux_partition **found_partition,
struct omap_mux **found_mux)
Expand All @@ -240,7 +240,7 @@ omap_mux_get_by_name(const char *muxname,
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 *mux = NULL;
Expand Down

0 comments on commit d1589f0

Please sign in to comment.