diff options
author | Alan Cox <alan@linux.intel.com> | 2012-07-14 10:31:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 16:00:41 -0400 |
commit | adc8d746caa67fff4b53ba3e5163a6cbacc3b523 (patch) | |
tree | e3f6c05f27c163b369ddd4da5f31d2a61bde6d3a /drivers/tty/tty_ldisc.c | |
parent | 6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db (diff) |
tty: move the termios object into the tty
This will let us sort out a whole pile of tty related races. The
alternative would be to keep points and refcount the termios objects.
However
1. They are tiny anyway
2. Many devices don't use the stored copies
3. We can remove a pty special case
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_ldisc.c')
-rw-r--r-- | drivers/tty/tty_ldisc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index 6f99c9959f0c..e6156c60d190 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c | |||
@@ -413,7 +413,7 @@ EXPORT_SYMBOL_GPL(tty_ldisc_flush); | |||
413 | static void tty_set_termios_ldisc(struct tty_struct *tty, int num) | 413 | static void tty_set_termios_ldisc(struct tty_struct *tty, int num) |
414 | { | 414 | { |
415 | mutex_lock(&tty->termios_mutex); | 415 | mutex_lock(&tty->termios_mutex); |
416 | tty->termios->c_line = num; | 416 | tty->termios.c_line = num; |
417 | mutex_unlock(&tty->termios_mutex); | 417 | mutex_unlock(&tty->termios_mutex); |
418 | } | 418 | } |
419 | 419 | ||
@@ -722,9 +722,9 @@ enable: | |||
722 | static void tty_reset_termios(struct tty_struct *tty) | 722 | static void tty_reset_termios(struct tty_struct *tty) |
723 | { | 723 | { |
724 | mutex_lock(&tty->termios_mutex); | 724 | mutex_lock(&tty->termios_mutex); |
725 | *tty->termios = tty->driver->init_termios; | 725 | tty->termios = tty->driver->init_termios; |
726 | tty->termios->c_ispeed = tty_termios_input_baud_rate(tty->termios); | 726 | tty->termios.c_ispeed = tty_termios_input_baud_rate(&tty->termios); |
727 | tty->termios->c_ospeed = tty_termios_baud_rate(tty->termios); | 727 | tty->termios.c_ospeed = tty_termios_baud_rate(&tty->termios); |
728 | mutex_unlock(&tty->termios_mutex); | 728 | mutex_unlock(&tty->termios_mutex); |
729 | } | 729 | } |
730 | 730 | ||
@@ -846,7 +846,7 @@ retry: | |||
846 | 846 | ||
847 | if (reset == 0) { | 847 | if (reset == 0) { |
848 | 848 | ||
849 | if (!tty_ldisc_reinit(tty, tty->termios->c_line)) | 849 | if (!tty_ldisc_reinit(tty, tty->termios.c_line)) |
850 | err = tty_ldisc_open(tty, tty->ldisc); | 850 | err = tty_ldisc_open(tty, tty->ldisc); |
851 | else | 851 | else |
852 | err = 1; | 852 | err = 1; |