diff options
| -rw-r--r-- | arch/um/drivers/line.c | 7 | ||||
| -rw-r--r-- | arch/um/drivers/line.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index acfd0e0fd0c9..482a7bd4a64c 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
| @@ -404,7 +404,7 @@ int line_open(struct line *lines, struct tty_struct *tty) | |||
| 404 | goto out_unlock; | 404 | goto out_unlock; |
| 405 | 405 | ||
| 406 | err = 0; | 406 | err = 0; |
| 407 | if (line->count++) | 407 | if (line->port.count++) |
| 408 | goto out_unlock; | 408 | goto out_unlock; |
| 409 | 409 | ||
| 410 | BUG_ON(tty->driver_data); | 410 | BUG_ON(tty->driver_data); |
| @@ -446,7 +446,7 @@ void line_close(struct tty_struct *tty, struct file * filp) | |||
| 446 | mutex_lock(&line->count_lock); | 446 | mutex_lock(&line->count_lock); |
| 447 | BUG_ON(!line->valid); | 447 | BUG_ON(!line->valid); |
| 448 | 448 | ||
| 449 | if (--line->count) | 449 | if (--line->port.count) |
| 450 | goto out_unlock; | 450 | goto out_unlock; |
| 451 | 451 | ||
| 452 | line->tty = NULL; | 452 | line->tty = NULL; |
| @@ -478,7 +478,7 @@ int setup_one_line(struct line *lines, int n, char *init, | |||
| 478 | 478 | ||
| 479 | mutex_lock(&line->count_lock); | 479 | mutex_lock(&line->count_lock); |
| 480 | 480 | ||
| 481 | if (line->count) { | 481 | if (line->port.count) { |
| 482 | *error_out = "Device is already open"; | 482 | *error_out = "Device is already open"; |
| 483 | goto out; | 483 | goto out; |
| 484 | } | 484 | } |
| @@ -663,6 +663,7 @@ int register_lines(struct line_driver *line_driver, | |||
| 663 | driver->init_termios = tty_std_termios; | 663 | driver->init_termios = tty_std_termios; |
| 664 | 664 | ||
| 665 | for (i = 0; i < nlines; i++) { | 665 | for (i = 0; i < nlines; i++) { |
| 666 | tty_port_init(&lines[i].port); | ||
| 666 | spin_lock_init(&lines[i].lock); | 667 | spin_lock_init(&lines[i].lock); |
| 667 | mutex_init(&lines[i].count_lock); | 668 | mutex_init(&lines[i].count_lock); |
| 668 | lines[i].driver = line_driver; | 669 | lines[i].driver = line_driver; |
diff --git a/arch/um/drivers/line.h b/arch/um/drivers/line.h index 0a1834719dba..0e06a1f441d7 100644 --- a/arch/um/drivers/line.h +++ b/arch/um/drivers/line.h | |||
| @@ -32,9 +32,9 @@ struct line_driver { | |||
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | struct line { | 34 | struct line { |
| 35 | struct tty_port port; | ||
| 35 | struct tty_struct *tty; | 36 | struct tty_struct *tty; |
| 36 | struct mutex count_lock; | 37 | struct mutex count_lock; |
| 37 | unsigned long count; | ||
| 38 | int valid; | 38 | int valid; |
| 39 | 39 | ||
| 40 | char *init_str; | 40 | char *init_str; |
