diff options
author | Tony Lindgren <tony@atomide.com> | 2011-02-14 18:40:20 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-02-14 18:40:49 -0500 |
commit | 3e16f92536334ccb464ed88cf4d8cc0dd43da106 (patch) | |
tree | 0ad6d2c96672cae89d339d0305e8001cde2833c7 /arch/arm/mach-omap2/serial.c | |
parent | 44dc046e93eb98d41048954f700b1927f7e288ed (diff) |
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: Tony Lindgren <tony@atomide.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 32e91a9c8b6b..74e25cd4bd3a 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -655,7 +655,7 @@ static void serial_out_override(struct uart_port *up, int offset, int value) | |||
655 | } | 655 | } |
656 | #endif | 656 | #endif |
657 | 657 | ||
658 | void __init omap_serial_early_init(void) | 658 | static int __init omap_serial_early_init(void) |
659 | { | 659 | { |
660 | int i = 0; | 660 | int i = 0; |
661 | 661 | ||
@@ -672,7 +672,7 @@ void __init omap_serial_early_init(void) | |||
672 | 672 | ||
673 | uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); | 673 | uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); |
674 | if (WARN_ON(!uart)) | 674 | if (WARN_ON(!uart)) |
675 | return; | 675 | return -ENODEV; |
676 | 676 | ||
677 | uart->oh = oh; | 677 | uart->oh = oh; |
678 | uart->num = i++; | 678 | uart->num = i++; |
@@ -691,7 +691,10 @@ void __init omap_serial_early_init(void) | |||
691 | */ | 691 | */ |
692 | uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; | 692 | uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; |
693 | } while (1); | 693 | } while (1); |
694 | |||
695 | return 0; | ||
694 | } | 696 | } |
697 | core_initcall(omap_serial_early_init); | ||
695 | 698 | ||
696 | /** | 699 | /** |
697 | * omap_serial_init_port() - initialize single serial port | 700 | * omap_serial_init_port() - initialize single serial port |