diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-02-10 04:43:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:21 -0500 |
commit | f28169d2000177e8b72ccc6d72887be779dceca8 (patch) | |
tree | 0ef842014c67d8a136cc26c99113b69e2ede87ea /arch/um/drivers/ssl.c | |
parent | d79a580936396bbcd2f4fae2c6215f9cf81e3c0d (diff) |
[PATCH] uml: return hotplug errors to host
I noticed that errors happening while hotplugging devices from the host were
never returned back to the mconsole client. In some cases, success was
returned instead of even an information-free error.
This patch cleans that up by having the low-level configuration code pass back
an error string along with an error code. At the top level, which knows
whether it is early boot time or responding to an mconsole request, the string
is printk'd or returned to the mconsole client.
There are also whitespace and trivial code cleanups in the surrounding code.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers/ssl.c')
-rw-r--r-- | arch/um/drivers/ssl.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index ed9c59082d0d..1e82430b8444 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c | |||
@@ -46,9 +46,9 @@ static struct chan_opts opts = { | |||
46 | .in_kernel = 1, | 46 | .in_kernel = 1, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static int ssl_config(char *str); | 49 | static int ssl_config(char *str, char **error_out); |
50 | static int ssl_get_config(char *dev, char *str, int size, char **error_out); | 50 | static int ssl_get_config(char *dev, char *str, int size, char **error_out); |
51 | static int ssl_remove(int n); | 51 | static int ssl_remove(int n, char **error_out); |
52 | 52 | ||
53 | static struct line_driver driver = { | 53 | static struct line_driver driver = { |
54 | .name = "UML serial line", | 54 | .name = "UML serial line", |
@@ -80,9 +80,10 @@ static struct line serial_lines[NR_PORTS] = | |||
80 | 80 | ||
81 | static struct lines lines = LINES_INIT(NR_PORTS); | 81 | static struct lines lines = LINES_INIT(NR_PORTS); |
82 | 82 | ||
83 | static int ssl_config(char *str) | 83 | static int ssl_config(char *str, char **error_out) |
84 | { | 84 | { |
85 | return line_config(serial_lines, ARRAY_SIZE(serial_lines), str, &opts); | 85 | return line_config(serial_lines, ARRAY_SIZE(serial_lines), str, &opts, |
86 | error_out); | ||
86 | } | 87 | } |
87 | 88 | ||
88 | static int ssl_get_config(char *dev, char *str, int size, char **error_out) | 89 | static int ssl_get_config(char *dev, char *str, int size, char **error_out) |
@@ -91,9 +92,10 @@ static int ssl_get_config(char *dev, char *str, int size, char **error_out) | |||
91 | size, error_out); | 92 | size, error_out); |
92 | } | 93 | } |
93 | 94 | ||
94 | static int ssl_remove(int n) | 95 | static int ssl_remove(int n, char **error_out) |
95 | { | 96 | { |
96 | return line_remove(serial_lines, ARRAY_SIZE(serial_lines), n); | 97 | return line_remove(serial_lines, ARRAY_SIZE(serial_lines), n, |
98 | error_out); | ||
97 | } | 99 | } |
98 | 100 | ||
99 | static int ssl_open(struct tty_struct *tty, struct file *filp) | 101 | static int ssl_open(struct tty_struct *tty, struct file *filp) |
@@ -212,7 +214,15 @@ __uml_exitcall(ssl_exit); | |||
212 | 214 | ||
213 | static int ssl_chan_setup(char *str) | 215 | static int ssl_chan_setup(char *str) |
214 | { | 216 | { |
215 | return line_setup(serial_lines, ARRAY_SIZE(serial_lines), str); | 217 | char *error; |
218 | int ret; | ||
219 | |||
220 | ret = line_setup(serial_lines, ARRAY_SIZE(serial_lines), str, &error); | ||
221 | if(ret < 0) | ||
222 | printk(KERN_ERR "Failed to set up serial line with " | ||
223 | "configuration string \"%s\" : %s\n", str, error); | ||
224 | |||
225 | return 1; | ||
216 | } | 226 | } |
217 | 227 | ||
218 | __setup("ssl", ssl_chan_setup); | 228 | __setup("ssl", ssl_chan_setup); |