diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-09-10 03:45:42 +0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-03-25 03:29:53 +0400 |
commit | cfe6b7c79daa0efa27f474f1fe2a88fd7af5cc47 (patch) | |
tree | 5030f25d83451e3b3e579bac4b9a2e561990048d /arch/um/drivers/ssl.c | |
parent | 31efcebb7d7196adcee73027f513d7c0bf572b47 (diff) | |
download | linux-cfe6b7c79daa0efa27f474f1fe2a88fd7af5cc47.tar.xz |
um: switch line.c tty drivers to dynamic device creation
Current code doesn't update the symlinks in /sys/dev/char when we add/remove
tty lines. Fixing that allows to stop messing with ->valid before the driver
registration, which is a Good Thing(tm) - we shouldn't have it set before we
really have the things set up and ready for line_open().
We need tty_driver available to call tty_{un,}register_device(), so we just
stash a reference to it into struct line_driver.
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 | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 23cffd6d85af..6398a47d035b 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c @@ -20,12 +20,6 @@ static const int ssl_version = 1; -/* Referenced only by tty_driver below - presumably it's locked correctly - * by the tty driver. - */ - -static struct tty_driver *ssl_driver; - #define NR_PORTS 64 static void ssl_announce(char *dev_name, int dev) @@ -164,7 +158,7 @@ static void ssl_console_write(struct console *c, const char *string, static struct tty_driver *ssl_console_device(struct console *c, int *index) { *index = c->index; - return ssl_driver; + return driver.driver; } static int ssl_console_setup(struct console *co, char *options) @@ -187,6 +181,7 @@ static struct console ssl_cons = { static int ssl_init(void) { char *new_title; + int err; int i; printk(KERN_INFO "Initializing software serial port version %d\n", @@ -196,16 +191,16 @@ static int ssl_init(void) char *s = conf[i]; if (!s) s = def_conf; - if (s && strcmp(s, "none") != 0) { + if (s && strcmp(s, "none") != 0) serial_lines[i].init_str = s; - serial_lines[i].valid = 1; - } spin_lock_init(&serial_lines[i].lock); mutex_init(&serial_lines[i].count_lock); serial_lines[i].driver = &driver; } - ssl_driver = register_lines(&driver, &ssl_ops, serial_lines, + err = register_lines(&driver, &ssl_ops, serial_lines, ARRAY_SIZE(serial_lines)); + if (err) + return err; new_title = add_xterm_umid(opts.xterm_title); if (new_title != NULL) |