From: Yinghai Lu Date: Mon, 16 Jul 2007 06:37:28 +0000 (-0700) Subject: console: console handover to preferred console X-Git-Tag: v2.6.23-rc1~1041 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d37bf60de0b4ddc1633cf278189d3c9bf28fe3d2;p=linux-2.6 console: console handover to preferred console for earlyprintk=ttyS0,9600 console=tty0 console=ttyS0,9600n8 the handover will happen from earlyser0 to tty0. but what we want is to hand over to ttyS0. Later with serial-convert-early_uart-to-earlycon-for-8250.patch, console=tty0 console=uart8250,io,0x3f8,9600n8 will handover to ttyS0 instead of tty0. Signed-off-by: Yinghai Lu Cc: Andi Kleen Cc: Bjorn Helgaas Cc: Russell King Cc: Gerd Hoffmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/printk.c b/kernel/printk.c index 4961410ba3..7ce9a8c133 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -985,12 +985,15 @@ void register_console(struct console *console) if (!(console->flags & CON_ENABLED)) return; - if (bootconsole) { + if (bootconsole && (console->flags & CON_CONSDEV)) { printk(KERN_INFO "console handover: boot [%s%d] -> real [%s%d]\n", bootconsole->name, bootconsole->index, console->name, console->index); unregister_console(bootconsole); console->flags &= ~CON_PRINTBUFFER; + } else { + printk(KERN_INFO "console [%s%d] enabled\n", + console->name, console->index); } /*