summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/line.c
diff options
context:
space:
mode:
authorJeff Dike2005-06-25 23:55:25 +0200
committerLinus Torvalds2005-06-26 01:24:36 +0200
commit29d56cfe3ca599ddc3ae9156e7e469c044d97b96 (patch)
tree7790477f5b138c249725fe8ecf9dc07794e9d1eb /arch/um/drivers/line.c
parent[PATCH] uml: time initialization tidying (diff)
downloadkernel-qcow2-linux-29d56cfe3ca599ddc3ae9156e7e469c044d97b96.tar.gz
kernel-qcow2-linux-29d56cfe3ca599ddc3ae9156e7e469c044d97b96.tar.xz
kernel-qcow2-linux-29d56cfe3ca599ddc3ae9156e7e469c044d97b96.zip
[PATCH] uml: hot-unplug code cleanup
Clean up the hot-unplugging code. There is now an id procedure which is called to figure out what device we're talking to. The error messages from that are now done from mconsole_remove instead of the driver. remove is now called with the device number, after it has been checked, so doesn't need to do sanity checking on it. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 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/line.c')
-rw-r--r--arch/um/drivers/line.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 0f59736db329..2bb4c4f5dec4 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -602,11 +602,26 @@ int line_get_config(char *name, struct line *lines, unsigned int num, char *str,
return n;
}
-int line_remove(struct line *lines, unsigned int num, char *str)
+int line_id(char **str, int *start_out, int *end_out)
+{
+ char *end;
+ int n;
+
+ n = simple_strtoul(*str, &end, 0);
+ if((*end != '\0') || (end == *str))
+ return -1;
+
+ *str = end;
+ *start_out = n;
+ *end_out = n;
+ return n;
+}
+
+int line_remove(struct line *lines, unsigned int num, int n)
{
char config[sizeof("conxxxx=none\0")];
- sprintf(config, "%s=none", str);
+ sprintf(config, "%d=none", n);
return !line_setup(lines, num, config, 0);
}