early_printk: consolidate random copies of identical code
[cascardo/linux.git] / arch / unicore32 / kernel / early_printk.c
index 3922255..9be0d5d 100644 (file)
@@ -33,21 +33,17 @@ static struct console early_ocd_console = {
        .index =        -1,
 };
 
-/* Direct interface for emergencies */
-static struct console *early_console = &early_ocd_console;
-
-static int __initdata keep_early;
-
 static int __init setup_early_printk(char *buf)
 {
-       if (!buf)
+       int keep_early;
+
+       if (!buf || early_console)
                return 0;
 
        if (strstr(buf, "keep"))
                keep_early = 1;
 
-       if (!strncmp(buf, "ocd", 3))
-               early_console = &early_ocd_console;
+       early_console = &early_ocd_console;
 
        if (keep_early)
                early_console->flags &= ~CON_BOOT;