aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-01-06 03:18:53 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:45 -0500
commitd571cd18f225542460b5d9b83e5e0d507be71656 (patch)
tree2434036d1a068afa831532f71deabcbd47527bc8 /arch
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')
-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
-rw-r--r--arch/um/include/line.h4
4 files changed, 14 insertions, 15 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)
500/* Common setup code for both startup command line and mconsole initialization. 500/* Common setup code for both startup command line and mconsole initialization.
501 * @lines contains the the array (of size @num) to modify; 501 * @lines contains the the array (of size @num) to modify;
502 * @init is the setup string; 502 * @init is the setup string;
503 * @all_allowed is a boolean saying if we can setup the whole @lines 503 */
504 * at once. For instance, it will be usually true for startup init. (where we
505 * can use con=xterm) and false for mconsole.*/
506 504
507int line_setup(struct line *lines, unsigned int num, char *init, int all_allowed) 505int line_setup(struct line *lines, unsigned int num, char *init)
508{ 506{
509 int i, n; 507 int i, n;
510 char *end; 508 char *end;
@@ -545,11 +543,6 @@ int line_setup(struct line *lines, unsigned int num, char *init, int all_allowed
545 } 543 }
546 } 544 }
547 } 545 }
548 else if(!all_allowed){
549 printk("line_setup - can't configure all devices from "
550 "mconsole\n");
551 return 0;
552 }
553 else { 546 else {
554 for(i = 0; i < num; i++){ 547 for(i = 0; i < num; i++){
555 if(lines[i].init_pri <= INIT_ALL){ 548 if(lines[i].init_pri <= INIT_ALL){
@@ -569,12 +562,18 @@ int line_config(struct line *lines, unsigned int num, char *str)
569{ 562{
570 char *new; 563 char *new;
571 564
565 if(*str == '='){
566 printk("line_config - can't configure all devices from "
567 "mconsole\n");
568 return 1;
569 }
570
572 new = kstrdup(str, GFP_KERNEL); 571 new = kstrdup(str, GFP_KERNEL);
573 if(new == NULL){ 572 if(new == NULL){
574 printk("line_config - kstrdup failed\n"); 573 printk("line_config - kstrdup failed\n");
575 return -ENOMEM; 574 return -ENOMEM;
576 } 575 }
577 return !line_setup(lines, num, new, 0); 576 return !line_setup(lines, num, new);
578} 577}
579 578
580int line_get_config(char *name, struct line *lines, unsigned int num, char *str, 579int 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)
628 char config[sizeof("conxxxx=none\0")]; 627 char config[sizeof("conxxxx=none\0")];
629 628
630 sprintf(config, "%d=none", n); 629 sprintf(config, "%d=none", n);
631 return !line_setup(lines, num, config, 0); 630 return !line_setup(lines, num, config);
632} 631}
633 632
634struct tty_driver *line_register_devfs(struct lines *set, 633struct 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);
224 224
225static int ssl_chan_setup(char *str) 225static int ssl_chan_setup(char *str)
226{ 226{
227 return line_setup(serial_lines, ARRAY_SIZE(serial_lines), str, 1); 227 return line_setup(serial_lines, ARRAY_SIZE(serial_lines), str);
228} 228}
229 229
230__setup("ssl", ssl_chan_setup); 230__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);
191 191
192static int console_chan_setup(char *str) 192static int console_chan_setup(char *str)
193{ 193{
194 return line_setup(vts, ARRAY_SIZE(vts), str, 1); 194 return line_setup(vts, ARRAY_SIZE(vts), str);
195} 195}
196__setup("con", console_chan_setup); 196__setup("con", console_chan_setup);
197__channel_help(console_chan_setup, "con"); 197__channel_help(console_chan_setup, "con");
diff --git a/arch/um/include/line.h b/arch/um/include/line.h
index 315788ce59fa..e22c9e0f2d02 100644
--- a/arch/um/include/line.h
+++ b/arch/um/include/line.h
@@ -76,8 +76,8 @@ struct lines {
76extern void line_close(struct tty_struct *tty, struct file * filp); 76extern void line_close(struct tty_struct *tty, struct file * filp);
77extern int line_open(struct line *lines, struct tty_struct *tty, 77extern int line_open(struct line *lines, struct tty_struct *tty,
78 struct chan_opts *opts); 78 struct chan_opts *opts);
79extern int line_setup(struct line *lines, unsigned int sizeof_lines, char *init, 79extern int line_setup(struct line *lines, unsigned int sizeof_lines,
80 int all_allowed); 80 char *init);
81extern int line_write(struct tty_struct *tty, const unsigned char *buf, 81extern int line_write(struct tty_struct *tty, const unsigned char *buf,
82 int len); 82 int len);
83extern void line_put_char(struct tty_struct *tty, unsigned char ch); 83extern void line_put_char(struct tty_struct *tty, unsigned char ch);