diff options
Diffstat (limited to 'arch/mips/kernel/early_printk.c')
-rw-r--r-- | arch/mips/kernel/early_printk.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c index 4fa54b230c09..9dccfa4752b2 100644 --- a/arch/mips/kernel/early_printk.c +++ b/arch/mips/kernel/early_printk.c | |||
@@ -12,7 +12,8 @@ | |||
12 | 12 | ||
13 | extern void prom_putchar(char); | 13 | extern void prom_putchar(char); |
14 | 14 | ||
15 | static void early_console_write(struct console *con, const char *s, unsigned n) | 15 | static void __init |
16 | early_console_write(struct console *con, const char *s, unsigned n) | ||
16 | { | 17 | { |
17 | while (n-- && *s) { | 18 | while (n-- && *s) { |
18 | if (*s == '\n') | 19 | if (*s == '\n') |
@@ -22,14 +23,20 @@ static void early_console_write(struct console *con, const char *s, unsigned n) | |||
22 | } | 23 | } |
23 | } | 24 | } |
24 | 25 | ||
25 | static struct console early_console = { | 26 | static struct console early_console __initdata = { |
26 | .name = "early", | 27 | .name = "early", |
27 | .write = early_console_write, | 28 | .write = early_console_write, |
28 | .flags = CON_PRINTBUFFER | CON_BOOT, | 29 | .flags = CON_PRINTBUFFER | CON_BOOT, |
29 | .index = -1 | 30 | .index = -1 |
30 | }; | 31 | }; |
31 | 32 | ||
33 | static int early_console_initialized __initdata; | ||
34 | |||
32 | void __init setup_early_printk(void) | 35 | void __init setup_early_printk(void) |
33 | { | 36 | { |
37 | if (early_console_initialized) | ||
38 | return; | ||
39 | early_console_initialized = 1; | ||
40 | |||
34 | register_console(&early_console); | 41 | register_console(&early_console); |
35 | } | 42 | } |