aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/early_printk.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-12-12 09:00:47 +0900
committerPaul Mundt <lethal@linux-sh.org>2006-12-12 09:00:47 +0900
commitb641fe016a29fe2c0c7b0d717a5918e3f067a44f (patch)
tree461143f1ed3f43dbbb6c5388020e24add1601ce0 /arch/sh/kernel/early_printk.c
parentsh: Fix .empty_zero_page alignment for PAGE_SIZE > 4096. (diff)
downloadlinux-dev-b641fe016a29fe2c0c7b0d717a5918e3f067a44f.tar.xz
linux-dev-b641fe016a29fe2c0c7b0d717a5918e3f067a44f.zip
sh: Use early_param() for earlyprintk parsing.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/early_printk.c')
-rw-r--r--arch/sh/kernel/early_printk.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c
index 60340823798a..560b91cdd15c 100644
--- a/arch/sh/kernel/early_printk.c
+++ b/arch/sh/kernel/early_printk.c
@@ -144,16 +144,16 @@ static struct console *early_console =
;
static int __initdata keep_early;
+static int early_console_initialized;
-int __init setup_early_printk(char *opt)
+int __init setup_early_printk(char *buf)
{
- char *space;
- char buf[256];
+ if (!buf)
+ return 0;
- strlcpy(buf, opt, sizeof(buf));
- space = strchr(buf, ' ');
- if (space)
- *space = 0;
+ if (early_console_initialized)
+ return 0;
+ early_console_initialized = 1;
if (strstr(buf, "keep"))
keep_early = 1;
@@ -175,12 +175,14 @@ int __init setup_early_printk(char *opt)
if (likely(early_console))
register_console(early_console);
- return 1;
+ return 0;
}
-__setup("earlyprintk=", setup_early_printk);
+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);