aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cypress_m8.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-14 10:31:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 16:00:41 -0400
commitadc8d746caa67fff4b53ba3e5163a6cbacc3b523 (patch)
treee3f6c05f27c163b369ddd4da5f31d2a61bde6d3a /drivers/usb/serial/cypress_m8.c
parent6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db (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/usb/serial/cypress_m8.c')
-rw-r--r--drivers/usb/serial/cypress_m8.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index b78c34eb5d3f..be34f153e566 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -922,38 +922,38 @@ static void cypress_set_termios(struct tty_struct *tty,
922 early enough */ 922 early enough */
923 if (!priv->termios_initialized) { 923 if (!priv->termios_initialized) {
924 if (priv->chiptype == CT_EARTHMATE) { 924 if (priv->chiptype == CT_EARTHMATE) {
925 *(tty->termios) = tty_std_termios; 925 tty->termios = tty_std_termios;
926 tty->termios->c_cflag = B4800 | CS8 | CREAD | HUPCL | 926 tty->termios.c_cflag = B4800 | CS8 | CREAD | HUPCL |
927 CLOCAL; 927 CLOCAL;
928 tty->termios->c_ispeed = 4800; 928 tty->termios.c_ispeed = 4800;
929 tty->termios->c_ospeed = 4800; 929 tty->termios.c_ospeed = 4800;
930 } else if (priv->chiptype == CT_CYPHIDCOM) { 930 } else if (priv->chiptype == CT_CYPHIDCOM) {
931 *(tty->termios) = tty_std_termios; 931 tty->termios = tty_std_termios;
932 tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | 932 tty->termios.c_cflag = B9600 | CS8 | CREAD | HUPCL |
933 CLOCAL; 933 CLOCAL;
934 tty->termios->c_ispeed = 9600; 934 tty->termios.c_ispeed = 9600;
935 tty->termios->c_ospeed = 9600; 935 tty->termios.c_ospeed = 9600;
936 } else if (priv->chiptype == CT_CA42V2) { 936 } else if (priv->chiptype == CT_CA42V2) {
937 *(tty->termios) = tty_std_termios; 937 tty->termios = tty_std_termios;
938 tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | 938 tty->termios.c_cflag = B9600 | CS8 | CREAD | HUPCL |
939 CLOCAL; 939 CLOCAL;
940 tty->termios->c_ispeed = 9600; 940 tty->termios.c_ispeed = 9600;
941 tty->termios->c_ospeed = 9600; 941 tty->termios.c_ospeed = 9600;
942 } 942 }
943 priv->termios_initialized = 1; 943 priv->termios_initialized = 1;
944 } 944 }
945 spin_unlock_irqrestore(&priv->lock, flags); 945 spin_unlock_irqrestore(&priv->lock, flags);
946 946
947 /* Unsupported features need clearing */ 947 /* Unsupported features need clearing */
948 tty->termios->c_cflag &= ~(CMSPAR|CRTSCTS); 948 tty->termios.c_cflag &= ~(CMSPAR|CRTSCTS);
949 949
950 cflag = tty->termios->c_cflag; 950 cflag = tty->termios.c_cflag;
951 iflag = tty->termios->c_iflag; 951 iflag = tty->termios.c_iflag;
952 952
953 /* check if there are new settings */ 953 /* check if there are new settings */
954 if (old_termios) { 954 if (old_termios) {
955 spin_lock_irqsave(&priv->lock, flags); 955 spin_lock_irqsave(&priv->lock, flags);
956 priv->tmp_termios = *(tty->termios); 956 priv->tmp_termios = tty->termios;
957 spin_unlock_irqrestore(&priv->lock, flags); 957 spin_unlock_irqrestore(&priv->lock, flags);
958 } 958 }
959 959
@@ -1021,7 +1021,7 @@ static void cypress_set_termios(struct tty_struct *tty,
1021 "4800bps."); 1021 "4800bps.");
1022 /* define custom termios settings for NMEA protocol */ 1022 /* define custom termios settings for NMEA protocol */
1023 1023
1024 tty->termios->c_iflag /* input modes - */ 1024 tty->termios.c_iflag /* input modes - */
1025 &= ~(IGNBRK /* disable ignore break */ 1025 &= ~(IGNBRK /* disable ignore break */
1026 | BRKINT /* disable break causes interrupt */ 1026 | BRKINT /* disable break causes interrupt */
1027 | PARMRK /* disable mark parity errors */ 1027 | PARMRK /* disable mark parity errors */
@@ -1031,10 +1031,10 @@ static void cypress_set_termios(struct tty_struct *tty,
1031 | ICRNL /* disable translate CR to NL */ 1031 | ICRNL /* disable translate CR to NL */
1032 | IXON); /* disable enable XON/XOFF flow control */ 1032 | IXON); /* disable enable XON/XOFF flow control */
1033 1033
1034 tty->termios->c_oflag /* output modes */ 1034 tty->termios.c_oflag /* output modes */
1035 &= ~OPOST; /* disable postprocess output char */ 1035 &= ~OPOST; /* disable postprocess output char */
1036 1036
1037 tty->termios->c_lflag /* line discipline modes */ 1037 tty->termios.c_lflag /* line discipline modes */
1038 &= ~(ECHO /* disable echo input characters */ 1038 &= ~(ECHO /* disable echo input characters */
1039 | ECHONL /* disable echo new line */ 1039 | ECHONL /* disable echo new line */
1040 | ICANON /* disable erase, kill, werase, and rprnt 1040 | ICANON /* disable erase, kill, werase, and rprnt
@@ -1200,7 +1200,7 @@ static void cypress_read_int_callback(struct urb *urb)
1200 1200
1201 /* hangup, as defined in acm.c... this might be a bad place for it 1201 /* hangup, as defined in acm.c... this might be a bad place for it
1202 * though */ 1202 * though */
1203 if (tty && !(tty->termios->c_cflag & CLOCAL) && 1203 if (tty && !(tty->termios.c_cflag & CLOCAL) &&
1204 !(priv->current_status & UART_CD)) { 1204 !(priv->current_status & UART_CD)) {
1205 dbg("%s - calling hangup", __func__); 1205 dbg("%s - calling hangup", __func__);
1206 tty_hangup(tty); 1206 tty_hangup(tty);