aboutsummaryrefslogtreecommitdiff
path: root/arch/um/drivers
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-01-06 00:18:54 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:46 -0800
commit418e55d49b0ec7d2e7a033f2dd083f5b2ab7d119 (patch)
treed1e598b98955774b270b0f3f8f4a4e63815ff97e /arch/um/drivers
parent9010772cdff36072dd509ec72c1a55fccde8e58e (diff)
[PATCH] uml: line_setup interface change
line_setup is changed to return the device which it set up, rather than just success or failure. This will be important in the line-config patch. 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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 1c2cc5d48bb..1352a212964 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)
}
}
}
- return 1;
+ return n == -1 ? num : n;
}
int line_config(struct line *lines, unsigned int num, char *str)
{
char *new;
+ int n;
if(*str == '='){
printk("line_config - can't configure all devices from "
@@ -573,7 +574,8 @@ int line_config(struct line *lines, unsigned int num, char *str)
printk("line_config - kstrdup failed\n");
return -ENOMEM;
}
- return !line_setup(lines, num, new);
+ n = line_setup(lines, num, new);
+ return n < 0 ? n : 0;
}
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)
int line_remove(struct line *lines, unsigned int num, int n)
{
+ int err;
char config[sizeof("conxxxx=none\0")];
sprintf(config, "%d=none", n);
- return !line_setup(lines, num, config);
+ err = line_setup(lines, num, config);
+ if(err >= 0)
+ err = 0;
+ return err;
}
struct tty_driver *line_register_devfs(struct lines *set,