diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-09-08 20:34:52 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-03-25 00:29:53 +0100 |
commit | da645f3be912a377ada97268e36360b0a4389ab0 (patch) | |
tree | e6d47406e497eb38a08e2d504cbb390a11b5bdbd /arch/um/drivers | |
parent | 8998af2b4f7a4dd500198f9a7bd4dc8411568b7d (diff) | |
download | linux-da645f3be912a377ada97268e36360b0a4389ab0.tar.bz2 |
um: switch line_remove() to setup_one_line()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r-- | arch/um/drivers/line.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index ac9bcfbbeee1..08c5fba6db84 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -640,14 +640,11 @@ int line_id(char **str, int *start_out, int *end_out) int line_remove(struct line *lines, unsigned int num, int n, char **error_out) { - int err; - char config[sizeof("conxxxx=none\0")]; - - sprintf(config, "%d=none", n); - err = line_setup(lines, num, config, error_out); - if (err >= 0) - err = 0; - return err; + if (n >= num) { + *error_out = "Device number out of range"; + return -EINVAL; + } + return setup_one_line(lines, n, "none", INIT_ONE, error_out); } struct tty_driver *register_lines(struct line_driver *line_driver, |