[PATCH] uml: network driver locking and code cleanup
[powerpc.git] / arch / um / drivers / ssl.c
index 6f13e7c..fe400ac 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/fs.h"
 #include "linux/tty.h"
 #include "linux/tty_driver.h"
@@ -47,9 +46,9 @@ static struct chan_opts opts = {
        .in_kernel      = 1,
 };
 
-static int ssl_config(char *str);
+static int ssl_config(char *str, char **error_out);
 static int ssl_get_config(char *dev, char *str, int size, char **error_out);
-static int ssl_remove(int n);
+static int ssl_remove(int n, char **error_out);
 
 static struct line_driver driver = {
        .name                   = "UML serial line",
@@ -65,6 +64,7 @@ static struct line_driver driver = {
        .symlink_from           = "serial",
        .symlink_to             = "tts",
        .mc  = {
+               .list           = LIST_HEAD_INIT(driver.mc.list),
                .name           = "ssl",
                .config         = ssl_config,
                .get_config     = ssl_get_config,
@@ -81,9 +81,10 @@ static struct line serial_lines[NR_PORTS] =
 
 static struct lines lines = LINES_INIT(NR_PORTS);
 
-static int ssl_config(char *str)
+static int ssl_config(char *str, char **error_out)
 {
-       return line_config(serial_lines, ARRAY_SIZE(serial_lines), str, &opts);
+       return line_config(serial_lines, ARRAY_SIZE(serial_lines), str, &opts,
+                          error_out);
 }
 
 static int ssl_get_config(char *dev, char *str, int size, char **error_out)
@@ -92,9 +93,10 @@ static int ssl_get_config(char *dev, char *str, int size, char **error_out)
                               size, error_out);
 }
 
-static int ssl_remove(int n)
+static int ssl_remove(int n, char **error_out)
 {
-       return line_remove(serial_lines, ARRAY_SIZE(serial_lines), n);
+       return line_remove(serial_lines, ARRAY_SIZE(serial_lines), n,
+                          error_out);
 }
 
 static int ssl_open(struct tty_struct *tty, struct file *filp)
@@ -213,7 +215,15 @@ __uml_exitcall(ssl_exit);
 
 static int ssl_chan_setup(char *str)
 {
-       return line_setup(serial_lines, ARRAY_SIZE(serial_lines), str);
+       char *error;
+       int ret;
+
+       ret = line_setup(serial_lines, ARRAY_SIZE(serial_lines), str, &error);
+       if(ret < 0)
+               printk(KERN_ERR "Failed to set up serial line with "
+                      "configuration string \"%s\" : %s\n", str, error);
+
+       return 1;
 }
 
 __setup("ssl", ssl_chan_setup);