summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-01-06 00:18:53 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:45 -0800
commitd571cd18f225542460b5d9b83e5e0d507be71656 (patch)
tree2434036d1a068afa831532f71deabcbd47527bc8 /arch/um/drivers
parent88890b88742debb97006df264b653d18acdc80d0 (diff)
[PATCH] uml: Move mconsole support out of generic code
A bit of restructuring which eliminates the all_allowed argument (which is mconsole-specific) to line_setup. That logic is moved to the mconsole callback. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r--arch/um/drivers/line.c21
-rw-r--r--arch/um/drivers/ssl.c2
-rw-r--r--arch/um/drivers/stdio_console.c2
3 files changed, 12 insertions, 13 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 80ade224d740..9af55ece198d 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -500,11 +500,9 @@ void close_lines(struct line *lines, int nlines)
/* Common setup code for both startup command line and mconsole initialization.
* @lines contains the the array (of size @num) to modify;
* @init is the setup string;
- * @all_allowed is a boolean saying if we can setup the whole @lines
- * at once. For instance, it will be usually true for startup init. (where we
- * can use con=xterm) and false for mconsole.*/
+ */
-int line_setup(struct line *lines, unsigned int num, char *init, int all_allowed)
+int line_setup(struct line *lines, unsigned int num, char *init)
{
int i, n;
char *end;
@@ -545,11 +543,6 @@ int line_setup(struct line *lines, unsigned int num, char *init, int all_allowed
}
}
}
- else if(!all_allowed){
- printk("line_setup - can't configure all devices from "
- "mconsole\n");
- return 0;
- }
else {
for(i = 0; i < num; i++){
if(lines[i].init_pri <= INIT_ALL){
@@ -569,12 +562,18 @@ int line_config(struct line *lines, unsigned int num, char *str)
{
char *new;
+ if(*str == '='){
+ printk("line_config - can't configure all devices from "
+ "mconsole\n");
+ return 1;
+ }
+
new = kstrdup(str, GFP_KERNEL);
if(new == NULL){
printk("line_config - kstrdup failed\n");
return -ENOMEM;
}
- return !line_setup(lines, num, new, 0);
+ return !line_setup(lines, num, new);
}
int line_get_config(char *name, struct line *lines, unsigned int num, char *str,
@@ -628,7 +627,7 @@ int line_remove(struct line *lines, unsigned int num, int n)
char config[sizeof("conxxxx=none\0")];
sprintf(config, "%d=none", n);
- return !line_setup(lines, num, config, 0);
+ return !line_setup(lines, num, config);
}
struct tty_driver *line_register_devfs(struct lines *set,
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c
index 8564784cd2e1..e1895d9babbe 100644
--- a/arch/um/drivers/ssl.c
+++ b/arch/um/drivers/ssl.c
@@ -224,7 +224,7 @@ __uml_exitcall(ssl_exit);
static int ssl_chan_setup(char *str)
{
- return line_setup(serial_lines, ARRAY_SIZE(serial_lines), str, 1);
+ return line_setup(serial_lines, ARRAY_SIZE(serial_lines), str);
}
__setup("ssl", ssl_chan_setup);
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
index b77f7d2ab83b..72000d3a19ee 100644
--- a/arch/um/drivers/stdio_console.c
+++ b/arch/um/drivers/stdio_console.c
@@ -191,7 +191,7 @@ __uml_exitcall(console_exit);
static int console_chan_setup(char *str)
{
- return line_setup(vts, ARRAY_SIZE(vts), str, 1);
+ return line_setup(vts, ARRAY_SIZE(vts), str);
}
__setup("con", console_chan_setup);
__channel_help(console_chan_setup, "con");