aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/early_printk.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-12-11 19:00:47 -0500
committerPaul Mundt <lethal@linux-sh.org>2006-12-11 19:00:47 -0500
commitb641fe016a29fe2c0c7b0d717a5918e3f067a44f (patch)
tree461143f1ed3f43dbbb6c5388020e24add1601ce0 /arch/sh/kernel/early_printk.c
parente2dfb912d3cea97d8b1d6750abbe9c942b6f73f5 (diff)
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 =
144 ; 144 ;
145 145
146static int __initdata keep_early; 146static int __initdata keep_early;
147static int early_console_initialized;
147 148
148int __init setup_early_printk(char *opt) 149int __init setup_early_printk(char *buf)
149{ 150{
150 char *space; 151 if (!buf)
151 char buf[256]; 152 return 0;
152 153
153 strlcpy(buf, opt, sizeof(buf)); 154 if (early_console_initialized)
154 space = strchr(buf, ' '); 155 return 0;
155 if (space) 156 early_console_initialized = 1;
156 *space = 0;
157 157
158 if (strstr(buf, "keep")) 158 if (strstr(buf, "keep"))
159 keep_early = 1; 159 keep_early = 1;
@@ -175,12 +175,14 @@ int __init setup_early_printk(char *opt)
175 if (likely(early_console)) 175 if (likely(early_console))
176 register_console(early_console); 176 register_console(early_console);
177 177
178 return 1; 178 return 0;
179} 179}
180__setup("earlyprintk=", setup_early_printk); 180early_param("earlyprintk", setup_early_printk);
181 181
182void __init disable_early_printk(void) 182void __init disable_early_printk(void)
183{ 183{
184 if (!early_console_initialized || !early_console)
185 return;
184 if (!keep_early) { 186 if (!keep_early) {
185 printk("disabling early console\n"); 187 printk("disabling early console\n");
186 unregister_console(early_console); 188 unregister_console(early_console);