]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/mips/kernel/early_printk.c
Driver core: change sysdev classes to use dynamic kobject names
[linux-2.6-omap-h63xx.git] / arch / mips / kernel / early_printk.c
index 304efdc5682f9776578eaa1f2ba402f549a06ecc..9dccfa4752b20b2eacdd366bf8be7c1f9c61a085 100644 (file)
@@ -12,7 +12,8 @@
 
 extern void prom_putchar(char);
 
-static void early_console_write(struct console *con, const char *s, unsigned n)
+static void __init
+early_console_write(struct console *con, const char *s, unsigned n)
 {
        while (n-- && *s) {
                if (*s == '\n')
@@ -22,19 +23,20 @@ static void early_console_write(struct console *con, const char *s, unsigned n)
        }
 }
 
-static struct console early_console = {
+static struct console early_console __initdata = {
        .name   = "early",
        .write  = early_console_write,
        .flags  = CON_PRINTBUFFER | CON_BOOT,
        .index  = -1
 };
 
+static int early_console_initialized __initdata;
+
 void __init setup_early_printk(void)
 {
-       register_console(&early_console);
-}
+       if (early_console_initialized)
+               return;
+       early_console_initialized = 1;
 
-void __init disable_early_printk(void)
-{
-       unregister_console(&early_console);
+       register_console(&early_console);
 }