aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/early_printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/early_printk.c')
-rw-r--r--arch/mips/kernel/early_printk.c11
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
13extern void prom_putchar(char); 13extern void prom_putchar(char);
14 14
15static void early_console_write(struct console *con, const char *s, unsigned n) 15static void __init
16early_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
25static struct console early_console = { 26static 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
33static int early_console_initialized __initdata;
34
32void __init setup_early_printk(void) 35void __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}