summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2005-03-28 03:57:38 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-28 03:57:38 -0800
commite758da38da22c0863cf96323077323080ffc9ad9 (patch)
tree5febc256e23492b6a7c8885f256ee8bd3fa9aec2 /kernel
parent798f347f11469414d73411cf41adc826ff5bb6bb (diff)
[PATCH] New console flag: CON_BOOT
CON_BOOT is like early printk in that it allows for output really early on. It's better than early printk because it unregisters automatically when a real console is initialised. So if you don't get consoles registering in console_init, there isn't a huge delay between the boot console unregistering and the real console starting. This is the case on PA-RISC where we have serial ports that aren't discovered until the PCI bus has been walked. I think all the current early printk users could be converted to this scheme with a minimal amount of effort. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index e5a2222f477e..5d5754964bf4 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -861,6 +861,11 @@ void register_console(struct console * console)
if (!(console->flags & CON_ENABLED))
return;
+ if (console_drivers && (console_drivers->flags & CON_BOOT)) {
+ unregister_console(console_drivers);
+ console->flags &= ~CON_PRINTBUFFER;
+ }
+
/*
* Put this console in the list - keep the
* preferred driver at the head of the list.