diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/line.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 1c2cc5d48bbb..1352a212964a 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -555,12 +555,13 @@ int line_setup(struct line *lines, unsigned int num, char *init) | |||
555 | } | 555 | } |
556 | } | 556 | } |
557 | } | 557 | } |
558 | return 1; | 558 | return n == -1 ? num : n; |
559 | } | 559 | } |
560 | 560 | ||
561 | int line_config(struct line *lines, unsigned int num, char *str) | 561 | int line_config(struct line *lines, unsigned int num, char *str) |
562 | { | 562 | { |
563 | char *new; | 563 | char *new; |
564 | int n; | ||
564 | 565 | ||
565 | if(*str == '='){ | 566 | if(*str == '='){ |
566 | printk("line_config - can't configure all devices from " | 567 | printk("line_config - can't configure all devices from " |
@@ -573,7 +574,8 @@ int line_config(struct line *lines, unsigned int num, char *str) | |||
573 | printk("line_config - kstrdup failed\n"); | 574 | printk("line_config - kstrdup failed\n"); |
574 | return -ENOMEM; | 575 | return -ENOMEM; |
575 | } | 576 | } |
576 | return !line_setup(lines, num, new); | 577 | n = line_setup(lines, num, new); |
578 | return n < 0 ? n : 0; | ||
577 | } | 579 | } |
578 | 580 | ||
579 | int line_get_config(char *name, struct line *lines, unsigned int num, char *str, | 581 | int line_get_config(char *name, struct line *lines, unsigned int num, char *str, |
@@ -624,10 +626,14 @@ int line_id(char **str, int *start_out, int *end_out) | |||
624 | 626 | ||
625 | int line_remove(struct line *lines, unsigned int num, int n) | 627 | int line_remove(struct line *lines, unsigned int num, int n) |
626 | { | 628 | { |
629 | int err; | ||
627 | char config[sizeof("conxxxx=none\0")]; | 630 | char config[sizeof("conxxxx=none\0")]; |
628 | 631 | ||
629 | sprintf(config, "%d=none", n); | 632 | sprintf(config, "%d=none", n); |
630 | return !line_setup(lines, num, config); | 633 | err = line_setup(lines, num, config); |
634 | if(err >= 0) | ||
635 | err = 0; | ||
636 | return err; | ||
631 | } | 637 | } |
632 | 638 | ||
633 | struct tty_driver *line_register_devfs(struct lines *set, | 639 | struct tty_driver *line_register_devfs(struct lines *set, |