aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorJohn Z. Bohach <jzb@aexorsyst.com>2006-03-24 06:18:19 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:27 -0500
commit2ea1c5392cc8ce249fb661db4f4cdfbbae373a89 (patch)
tree07e612d8e1e6c015f7da2702f2af4129e63db15c /kernel/printk.c
parent7e9dd124b90af80824754f68c0b246cfd0fb624b (diff)
[PATCH] console_setup() depends (wrongly?) on CONFIG_PRINTK
It appears that console_setup() code only gets compiled into the kernel if CONFIG_PRINTK is enabled. One detrimental side-effect of this is that serial8250_console_setup() never gets invoked when CONFIG_PRINTK is not set, resulting in baud rate not being read/parsed from command line (i.e. console=ttyS0,115200n8 is ignored, at least the baud rate part...) Attached patch moves console_setup() code from inside #ifdef CONFIG_PRINTK to outside (in printk.c), removing dependence on said config. option. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 13ced0f7828f..8cc19431e74b 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -122,44 +122,6 @@ static char *log_buf = __log_buf;
122static int log_buf_len = __LOG_BUF_LEN; 122static int log_buf_len = __LOG_BUF_LEN;
123static unsigned long logged_chars; /* Number of chars produced since last read+clear operation */ 123static unsigned long logged_chars; /* Number of chars produced since last read+clear operation */
124 124
125/*
126 * Setup a list of consoles. Called from init/main.c
127 */
128static int __init console_setup(char *str)
129{
130 char name[sizeof(console_cmdline[0].name)];
131 char *s, *options;
132 int idx;
133
134 /*
135 * Decode str into name, index, options.
136 */
137 if (str[0] >= '0' && str[0] <= '9') {
138 strcpy(name, "ttyS");
139 strncpy(name + 4, str, sizeof(name) - 5);
140 } else
141 strncpy(name, str, sizeof(name) - 1);
142 name[sizeof(name) - 1] = 0;
143 if ((options = strchr(str, ',')) != NULL)
144 *(options++) = 0;
145#ifdef __sparc__
146 if (!strcmp(str, "ttya"))
147 strcpy(name, "ttyS0");
148 if (!strcmp(str, "ttyb"))
149 strcpy(name, "ttyS1");
150#endif
151 for (s = name; *s; s++)
152 if ((*s >= '0' && *s <= '9') || *s == ',')
153 break;
154 idx = simple_strtoul(s, NULL, 10);
155 *s = 0;
156
157 add_preferred_console(name, idx, options);
158 return 1;
159}
160
161__setup("console=", console_setup);
162
163static int __init log_buf_len_setup(char *str) 125static int __init log_buf_len_setup(char *str)
164{ 126{
165 unsigned long size = memparse(str, &str); 127 unsigned long size = memparse(str, &str);
@@ -659,6 +621,44 @@ static void call_console_drivers(unsigned long start, unsigned long end)
659 621
660#endif 622#endif
661 623
624/*
625 * Set up a list of consoles. Called from init/main.c
626 */
627static int __init console_setup(char *str)
628{
629 char name[sizeof(console_cmdline[0].name)];
630 char *s, *options;
631 int idx;
632
633 /*
634 * Decode str into name, index, options.
635 */
636 if (str[0] >= '0' && str[0] <= '9') {
637 strcpy(name, "ttyS");
638 strncpy(name + 4, str, sizeof(name) - 5);
639 } else {
640 strncpy(name, str, sizeof(name) - 1);
641 }
642 name[sizeof(name) - 1] = 0;
643 if ((options = strchr(str, ',')) != NULL)
644 *(options++) = 0;
645#ifdef __sparc__
646 if (!strcmp(str, "ttya"))
647 strcpy(name, "ttyS0");
648 if (!strcmp(str, "ttyb"))
649 strcpy(name, "ttyS1");
650#endif
651 for (s = name; *s; s++)
652 if ((*s >= '0' && *s <= '9') || *s == ',')
653 break;
654 idx = simple_strtoul(s, NULL, 10);
655 *s = 0;
656
657 add_preferred_console(name, idx, options);
658 return 1;
659}
660__setup("console=", console_setup);
661
662/** 662/**
663 * add_preferred_console - add a device to the list of preferred consoles. 663 * add_preferred_console - add a device to the list of preferred consoles.
664 * @name: device name 664 * @name: device name