diff options
Diffstat (limited to 'arch/um/drivers/stdio_console.c')
-rw-r--r-- | arch/um/drivers/stdio_console.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c index 088776f01908..6d244f470968 100644 --- a/arch/um/drivers/stdio_console.c +++ b/arch/um/drivers/stdio_console.c | |||
@@ -76,9 +76,9 @@ static struct line_driver driver = { | |||
76 | /* The array is initialized by line_init, at initcall time. The | 76 | /* The array is initialized by line_init, at initcall time. The |
77 | * elements are locked individually as needed. | 77 | * elements are locked individually as needed. |
78 | */ | 78 | */ |
79 | static struct line vts[MAX_TTYS] = { LINE_INIT(CONFIG_CON_ZERO_CHAN, &driver), | 79 | static char *vt_conf[MAX_TTYS]; |
80 | [ 1 ... MAX_TTYS - 1 ] = | 80 | static char *def_conf; |
81 | LINE_INIT(CONFIG_CON_CHAN, &driver) }; | 81 | static struct line vts[MAX_TTYS]; |
82 | 82 | ||
83 | static int con_config(char *str, char **error_out) | 83 | static int con_config(char *str, char **error_out) |
84 | { | 84 | { |
@@ -160,7 +160,22 @@ static struct console stdiocons = { | |||
160 | static int stdio_init(void) | 160 | static int stdio_init(void) |
161 | { | 161 | { |
162 | char *new_title; | 162 | char *new_title; |
163 | 163 | int i; | |
164 | |||
165 | for (i = 0; i < MAX_TTYS; i++) { | ||
166 | char *s = vt_conf[i]; | ||
167 | if (!s) | ||
168 | s = def_conf; | ||
169 | if (!s) | ||
170 | s = i ? CONFIG_CON_CHAN : CONFIG_CON_ZERO_CHAN; | ||
171 | if (s && strcmp(s, "none") != 0) { | ||
172 | vts[i].init_str = s; | ||
173 | vts[i].valid = 1; | ||
174 | } | ||
175 | spin_lock_init(&vts[i].lock); | ||
176 | spin_lock_init(&vts[i].count_lock); | ||
177 | vts[i].driver = &driver; | ||
178 | } | ||
164 | console_driver = register_lines(&driver, &console_ops, vts, | 179 | console_driver = register_lines(&driver, &console_ops, vts, |
165 | ARRAY_SIZE(vts)); | 180 | ARRAY_SIZE(vts)); |
166 | if (console_driver == NULL) | 181 | if (console_driver == NULL) |
@@ -189,14 +204,7 @@ __uml_exitcall(console_exit); | |||
189 | 204 | ||
190 | static int console_chan_setup(char *str) | 205 | static int console_chan_setup(char *str) |
191 | { | 206 | { |
192 | char *error; | 207 | line_setup(vt_conf, MAX_TTYS, &def_conf, str, "console"); |
193 | int ret; | ||
194 | |||
195 | ret = line_setup(vts, ARRAY_SIZE(vts), str, &error); | ||
196 | if(ret < 0) | ||
197 | printk(KERN_ERR "Failed to set up console with " | ||
198 | "configuration string \"%s\" : %s\n", str, error); | ||
199 | |||
200 | return 1; | 208 | return 1; |
201 | } | 209 | } |
202 | __setup("con", console_chan_setup); | 210 | __setup("con", console_chan_setup); |