diff options
Diffstat (limited to 'arch/x86_64/kernel/early_printk.c')
-rw-r--r-- | arch/x86_64/kernel/early_printk.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c index 140051e07fa6..e22ecd54870d 100644 --- a/arch/x86_64/kernel/early_printk.c +++ b/arch/x86_64/kernel/early_printk.c | |||
@@ -215,20 +215,16 @@ void early_printk(const char *fmt, ...) | |||
215 | 215 | ||
216 | static int __initdata keep_early; | 216 | static int __initdata keep_early; |
217 | 217 | ||
218 | int __init setup_early_printk(char *opt) | 218 | static int __init setup_early_printk(char *buf) |
219 | { | 219 | { |
220 | char *space; | 220 | if (!buf) |
221 | char buf[256]; | 221 | return 0; |
222 | 222 | ||
223 | if (early_console_initialized) | 223 | if (early_console_initialized) |
224 | return 1; | 224 | return 0; |
225 | 225 | early_console_initialized = 1; | |
226 | strlcpy(buf,opt,sizeof(buf)); | ||
227 | space = strchr(buf, ' '); | ||
228 | if (space) | ||
229 | *space = 0; | ||
230 | 226 | ||
231 | if (strstr(buf,"keep")) | 227 | if (!strcmp(buf,"keep")) |
232 | keep_early = 1; | 228 | keep_early = 1; |
233 | 229 | ||
234 | if (!strncmp(buf, "serial", 6)) { | 230 | if (!strncmp(buf, "serial", 6)) { |
@@ -248,11 +244,12 @@ int __init setup_early_printk(char *opt) | |||
248 | early_console = &simnow_console; | 244 | early_console = &simnow_console; |
249 | keep_early = 1; | 245 | keep_early = 1; |
250 | } | 246 | } |
251 | early_console_initialized = 1; | ||
252 | register_console(early_console); | 247 | register_console(early_console); |
253 | return 0; | 248 | return 0; |
254 | } | 249 | } |
255 | 250 | ||
251 | early_param("earlyprintk", setup_early_printk); | ||
252 | |||
256 | void __init disable_early_printk(void) | 253 | void __init disable_early_printk(void) |
257 | { | 254 | { |
258 | if (!early_console_initialized || !early_console) | 255 | if (!early_console_initialized || !early_console) |
@@ -266,4 +263,3 @@ void __init disable_early_printk(void) | |||
266 | } | 263 | } |
267 | } | 264 | } |
268 | 265 | ||
269 | __setup("earlyprintk=", setup_early_printk); | ||