x86_64: early_print kernel console should send CRLF not LFCR
[sfrench/cifs-2.6.git] / arch / x86_64 / kernel / early_printk.c
index 92213d2b7c110ef070edfdb14313e6fc2c9ad2cd..296d2b0c5d886cf8e79e990cda8baca95604df68 100644 (file)
@@ -91,9 +91,9 @@ static int early_serial_putc(unsigned char ch)
 static void early_serial_write(struct console *con, const char *s, unsigned n)
 {
        while (*s && n-- > 0) {
-               early_serial_putc(*s);
                if (*s == '\n')
                        early_serial_putc('\r');
+               early_serial_putc(*s);
                s++;
        }
 }
@@ -243,22 +243,12 @@ static int __init setup_early_printk(char *buf)
                early_console = &simnow_console;
                keep_early = 1;
        }
+
+       if (keep_early)
+               early_console->flags &= ~CON_BOOT;
+       else
+               early_console->flags |= CON_BOOT;
        register_console(early_console);
        return 0;
 }
-
 early_param("earlyprintk", setup_early_printk);
-
-void __init disable_early_printk(void)
-{
-       if (!early_console_initialized || !early_console)
-               return;
-       if (!keep_early) {
-               printk("disabling early console\n");
-               unregister_console(early_console);
-               early_console_initialized = 0;
-       } else {
-               printk("keeping early console\n");
-       }
-}
-