diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-09-09 17:25:00 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-03-25 00:29:53 +0100 |
commit | 43574c1afea4f798592c03cf4d4ecea4fd0a8416 (patch) | |
tree | 0681a51541bd247fd7ea5a363182397383239a39 /arch/um/drivers/ssl.c | |
parent | fe9a6b002988372406baf5aeefc046677782365e (diff) | |
download | blackbird-op-linux-43574c1afea4f798592c03cf4d4ecea4fd0a8416.tar.gz blackbird-op-linux-43574c1afea4f798592c03cf4d4ecea4fd0a8416.zip |
um: get rid of the init_prio mess
make line_setup() act on a separate array of conf strings + default conf,
have lines array initialized explicitly by that data, bury LINE_INIT()
macro from hell.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers/ssl.c')
-rw-r--r-- | arch/um/drivers/ssl.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 9d8c20af6f80..445288ff0650 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c @@ -71,8 +71,9 @@ static struct line_driver driver = { /* The array is initialized by line_init, at initcall time. The * elements are locked individually as needed. */ -static struct line serial_lines[NR_PORTS] = - { [0 ... NR_PORTS - 1] = LINE_INIT(CONFIG_SSL_CHAN, &driver) }; +static char *conf[NR_PORTS]; +static char *def_conf = CONFIG_SSL_CHAN; +static struct line serial_lines[NR_PORTS]; static int ssl_config(char *str, char **error_out) { @@ -186,9 +187,23 @@ static struct console ssl_cons = { static int ssl_init(void) { char *new_title; + int i; printk(KERN_INFO "Initializing software serial port version %d\n", ssl_version); + + for (i = 0; i < NR_PORTS; i++) { + char *s = conf[i]; + if (!s) + s = def_conf; + if (s && strcmp(s, "none") != 0) { + serial_lines[i].init_str = s; + serial_lines[i].valid = 1; + } + spin_lock_init(&serial_lines[i].lock); + spin_lock_init(&serial_lines[i].count_lock); + serial_lines[i].driver = &driver; + } ssl_driver = register_lines(&driver, &ssl_ops, serial_lines, ARRAY_SIZE(serial_lines)); @@ -214,14 +229,7 @@ __uml_exitcall(ssl_exit); static int ssl_chan_setup(char *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); - + line_setup(conf, NR_PORTS, &def_conf, str, "serial line"); return 1; } |