Commit 3e16f925 authored by Tony Lindgren's avatar Tony Lindgren

omap2+: Fix omap_serial_early_init to work with init_early hook

The new init_early hook happens at the end of setup_arch,
which is too early for kzalloc. However, there's no need
to call omap_serial_early_init that early, so fix this
by setting it up as a core_initcall.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Tested-by: default avatarKevin Hilman <khilman@ti.com>
parent 44dc046e
...@@ -398,8 +398,6 @@ void __init omap2_init_common_infrastructure(void) ...@@ -398,8 +398,6 @@ void __init omap2_init_common_infrastructure(void)
void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1) struct omap_sdrc_params *sdrc_cs1)
{ {
omap_serial_early_init();
if (cpu_is_omap24xx() || cpu_is_omap34xx()) { if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
omap2_sdrc_init(sdrc_cs0, sdrc_cs1); omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
_omap2_init_reprogram_sdrc(); _omap2_init_reprogram_sdrc();
......
...@@ -655,7 +655,7 @@ static void serial_out_override(struct uart_port *up, int offset, int value) ...@@ -655,7 +655,7 @@ static void serial_out_override(struct uart_port *up, int offset, int value)
} }
#endif #endif
void __init omap_serial_early_init(void) static int __init omap_serial_early_init(void)
{ {
int i = 0; int i = 0;
...@@ -672,7 +672,7 @@ void __init omap_serial_early_init(void) ...@@ -672,7 +672,7 @@ void __init omap_serial_early_init(void)
uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL);
if (WARN_ON(!uart)) if (WARN_ON(!uart))
return; return -ENODEV;
uart->oh = oh; uart->oh = oh;
uart->num = i++; uart->num = i++;
...@@ -691,7 +691,10 @@ void __init omap_serial_early_init(void) ...@@ -691,7 +691,10 @@ void __init omap_serial_early_init(void)
*/ */
uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET;
} while (1); } while (1);
return 0;
} }
core_initcall(omap_serial_early_init);
/** /**
* omap_serial_init_port() - initialize single serial port * omap_serial_init_port() - initialize single serial port
......
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
struct omap_board_data; struct omap_board_data;
extern void __init omap_serial_early_init(void);
extern void omap_serial_init(void); extern void omap_serial_init(void);
extern void omap_serial_init_port(struct omap_board_data *bdata); extern void omap_serial_init_port(struct omap_board_data *bdata);
extern int omap_uart_can_sleep(void); extern int omap_uart_can_sleep(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment