aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
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
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')
-rw-r--r--drivers/usb/class/cdc-acm.c2
-rw-r--r--drivers/usb/serial/ark3116.c4
-rw-r--r--drivers/usb/serial/belkin_sa.c2
-rw-r--r--drivers/usb/serial/cp210x.c8
-rw-r--r--drivers/usb/serial/cypress_m8.c40
-rw-r--r--drivers/usb/serial/digi_acceleport.c14
-rw-r--r--drivers/usb/serial/empeg.c2
-rw-r--r--drivers/usb/serial/f81232.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
-rw-r--r--drivers/usb/serial/io_edgeport.c12
-rw-r--r--drivers/usb/serial/io_ti.c12
-rw-r--r--drivers/usb/serial/ir-usb.c2
-rw-r--r--drivers/usb/serial/iuu_phoenix.c28
-rw-r--r--drivers/usb/serial/keyspan.c6
-rw-r--r--drivers/usb/serial/keyspan_pda.c4
-rw-r--r--drivers/usb/serial/kl5kusb105.c18
-rw-r--r--drivers/usb/serial/kobil_sct.c14
-rw-r--r--drivers/usb/serial/mct_u232.c4
-rw-r--r--drivers/usb/serial/mos7720.c14
-rw-r--r--drivers/usb/serial/mos7840.c12
-rw-r--r--drivers/usb/serial/oti6858.c10
-rw-r--r--drivers/usb/serial/pl2303.c6
-rw-r--r--drivers/usb/serial/quatech2.c4
-rw-r--r--drivers/usb/serial/sierra.c2
-rw-r--r--drivers/usb/serial/spcp8x5.c12
-rw-r--r--drivers/usb/serial/ssu100.c4
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c10
-rw-r--r--drivers/usb/serial/usb-serial.c2
-rw-r--r--drivers/usb/serial/usb_wwan.c2
-rw-r--r--drivers/usb/serial/whiteheat.c2
30 files changed, 128 insertions, 128 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 36a2a0b7b82c..bb2e37f7db26 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -826,7 +826,7 @@ static void acm_tty_set_termios(struct tty_struct *tty,
826 struct ktermios *termios_old) 826 struct ktermios *termios_old)
827{ 827{
828 struct acm *acm = tty->driver_data; 828 struct acm *acm = tty->driver_data;
829 struct ktermios *termios = tty->termios; 829 struct ktermios *termios = &tty->termios;
830 struct usb_cdc_line_coding newline; 830 struct usb_cdc_line_coding newline;
831 int newctrl = acm->ctrlout; 831 int newctrl = acm->ctrlout;
832 832
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index f8ce97d8b0ad..3b98fb733362 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -215,7 +215,7 @@ static void ark3116_release(struct usb_serial *serial)
215 215
216static void ark3116_init_termios(struct tty_struct *tty) 216static void ark3116_init_termios(struct tty_struct *tty)
217{ 217{
218 struct ktermios *termios = tty->termios; 218 struct ktermios *termios = &tty->termios;
219 *termios = tty_std_termios; 219 *termios = tty_std_termios;
220 termios->c_cflag = B9600 | CS8 220 termios->c_cflag = B9600 | CS8
221 | CREAD | HUPCL | CLOCAL; 221 | CREAD | HUPCL | CLOCAL;
@@ -229,7 +229,7 @@ static void ark3116_set_termios(struct tty_struct *tty,
229{ 229{
230 struct usb_serial *serial = port->serial; 230 struct usb_serial *serial = port->serial;
231 struct ark3116_private *priv = usb_get_serial_port_data(port); 231 struct ark3116_private *priv = usb_get_serial_port_data(port);
232 struct ktermios *termios = tty->termios; 232 struct ktermios *termios = &tty->termios;
233 unsigned int cflag = termios->c_cflag; 233 unsigned int cflag = termios->c_cflag;
234 int bps = tty_get_baud_rate(tty); 234 int bps = tty_get_baud_rate(tty);
235 int quot; 235 int quot;
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 6b7365632951..a46df73ee96e 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -307,7 +307,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
307 unsigned long control_state; 307 unsigned long control_state;
308 int bad_flow_control; 308 int bad_flow_control;
309 speed_t baud; 309 speed_t baud;
310 struct ktermios *termios = tty->termios; 310 struct ktermios *termios = &tty->termios;
311 311
312 iflag = termios->c_iflag; 312 iflag = termios->c_iflag;
313 cflag = termios->c_cflag; 313 cflag = termios->c_cflag;
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 1e71079ce33b..ba5e07e188a0 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -469,7 +469,7 @@ static void cp210x_get_termios(struct tty_struct *tty,
469 469
470 if (tty) { 470 if (tty) {
471 cp210x_get_termios_port(tty->driver_data, 471 cp210x_get_termios_port(tty->driver_data,
472 &tty->termios->c_cflag, &baud); 472 &tty->termios.c_cflag, &baud);
473 tty_encode_baud_rate(tty, baud, baud); 473 tty_encode_baud_rate(tty, baud, baud);
474 } 474 }
475 475
@@ -631,7 +631,7 @@ static void cp210x_change_speed(struct tty_struct *tty,
631{ 631{
632 u32 baud; 632 u32 baud;
633 633
634 baud = tty->termios->c_ospeed; 634 baud = tty->termios.c_ospeed;
635 635
636 /* This maps the requested rate to a rate valid on cp2102 or cp2103, 636 /* This maps the requested rate to a rate valid on cp2102 or cp2103,
637 * or to an arbitrary rate in [1M,2M]. 637 * or to an arbitrary rate in [1M,2M].
@@ -665,10 +665,10 @@ static void cp210x_set_termios(struct tty_struct *tty,
665 if (!tty) 665 if (!tty)
666 return; 666 return;
667 667
668 cflag = tty->termios->c_cflag; 668 cflag = tty->termios.c_cflag;
669 old_cflag = old_termios->c_cflag; 669 old_cflag = old_termios->c_cflag;
670 670
671 if (tty->termios->c_ospeed != old_termios->c_ospeed) 671 if (tty->termios.c_ospeed != old_termios->c_ospeed)
672 cp210x_change_speed(tty, port, old_termios); 672 cp210x_change_speed(tty, port, old_termios);
673 673
674 /* If the number of data bits is to be updated */ 674 /* If the number of data bits is to be updated */
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);
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index b5cd838093ef..afd9d2ec577b 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -687,8 +687,8 @@ static void digi_set_termios(struct tty_struct *tty,
687 struct usb_serial_port *port, struct ktermios *old_termios) 687 struct usb_serial_port *port, struct ktermios *old_termios)
688{ 688{
689 struct digi_port *priv = usb_get_serial_port_data(port); 689 struct digi_port *priv = usb_get_serial_port_data(port);
690 unsigned int iflag = tty->termios->c_iflag; 690 unsigned int iflag = tty->termios.c_iflag;
691 unsigned int cflag = tty->termios->c_cflag; 691 unsigned int cflag = tty->termios.c_cflag;
692 unsigned int old_iflag = old_termios->c_iflag; 692 unsigned int old_iflag = old_termios->c_iflag;
693 unsigned int old_cflag = old_termios->c_cflag; 693 unsigned int old_cflag = old_termios->c_cflag;
694 unsigned char buf[32]; 694 unsigned char buf[32];
@@ -709,7 +709,7 @@ static void digi_set_termios(struct tty_struct *tty,
709 /* don't set RTS if using hardware flow control */ 709 /* don't set RTS if using hardware flow control */
710 /* and throttling input */ 710 /* and throttling input */
711 modem_signals = TIOCM_DTR; 711 modem_signals = TIOCM_DTR;
712 if (!(tty->termios->c_cflag & CRTSCTS) || 712 if (!(tty->termios.c_cflag & CRTSCTS) ||
713 !test_bit(TTY_THROTTLED, &tty->flags)) 713 !test_bit(TTY_THROTTLED, &tty->flags))
714 modem_signals |= TIOCM_RTS; 714 modem_signals |= TIOCM_RTS;
715 digi_set_modem_signals(port, modem_signals, 1); 715 digi_set_modem_signals(port, modem_signals, 1);
@@ -748,7 +748,7 @@ static void digi_set_termios(struct tty_struct *tty,
748 } 748 }
749 } 749 }
750 /* set parity */ 750 /* set parity */
751 tty->termios->c_cflag &= ~CMSPAR; 751 tty->termios.c_cflag &= ~CMSPAR;
752 752
753 if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) { 753 if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) {
754 if (cflag&PARENB) { 754 if (cflag&PARENB) {
@@ -1124,8 +1124,8 @@ static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
1124 1124
1125 /* set termios settings */ 1125 /* set termios settings */
1126 if (tty) { 1126 if (tty) {
1127 not_termios.c_cflag = ~tty->termios->c_cflag; 1127 not_termios.c_cflag = ~tty->termios.c_cflag;
1128 not_termios.c_iflag = ~tty->termios->c_iflag; 1128 not_termios.c_iflag = ~tty->termios.c_iflag;
1129 digi_set_termios(tty, port, &not_termios); 1129 digi_set_termios(tty, port, &not_termios);
1130 } 1130 }
1131 return 0; 1131 return 0;
@@ -1500,7 +1500,7 @@ static int digi_read_oob_callback(struct urb *urb)
1500 1500
1501 rts = 0; 1501 rts = 0;
1502 if (tty) 1502 if (tty)
1503 rts = tty->termios->c_cflag & CRTSCTS; 1503 rts = tty->termios.c_cflag & CRTSCTS;
1504 1504
1505 if (tty && opcode == DIGI_CMD_READ_INPUT_SIGNALS) { 1505 if (tty && opcode == DIGI_CMD_READ_INPUT_SIGNALS) {
1506 spin_lock(&priv->dp_port_lock); 1506 spin_lock(&priv->dp_port_lock);
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index cdf61dd07318..34e86383090a 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -87,7 +87,7 @@ static int empeg_startup(struct usb_serial *serial)
87 87
88static void empeg_init_termios(struct tty_struct *tty) 88static void empeg_init_termios(struct tty_struct *tty)
89{ 89{
90 struct ktermios *termios = tty->termios; 90 struct ktermios *termios = &tty->termios;
91 91
92 /* 92 /*
93 * The empeg-car player wants these particular tty settings. 93 * The empeg-car player wants these particular tty settings.
diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 499b15fd82f1..42c604bc7ce4 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -173,7 +173,7 @@ static void f81232_set_termios(struct tty_struct *tty,
173 /* FIXME - Stubbed out for now */ 173 /* FIXME - Stubbed out for now */
174 174
175 /* Don't change anything if nothing has changed */ 175 /* Don't change anything if nothing has changed */
176 if (!tty_termios_hw_change(tty->termios, old_termios)) 176 if (!tty_termios_hw_change(&tty->termios, old_termios))
177 return; 177 return;
178 178
179 /* Do the real work here... */ 179 /* Do the real work here... */
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index bc912e5a3beb..4b8b41a3351f 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2081,7 +2081,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
2081{ 2081{
2082 struct usb_device *dev = port->serial->dev; 2082 struct usb_device *dev = port->serial->dev;
2083 struct ftdi_private *priv = usb_get_serial_port_data(port); 2083 struct ftdi_private *priv = usb_get_serial_port_data(port);
2084 struct ktermios *termios = tty->termios; 2084 struct ktermios *termios = &tty->termios;
2085 unsigned int cflag = termios->c_cflag; 2085 unsigned int cflag = termios->c_cflag;
2086 __u16 urb_value; /* will hold the new flags */ 2086 __u16 urb_value; /* will hold the new flags */
2087 2087
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index e1f5ccd1e8f8..f435575c4e6e 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -1458,7 +1458,7 @@ static void edge_throttle(struct tty_struct *tty)
1458 } 1458 }
1459 1459
1460 /* if we are implementing RTS/CTS, toggle that line */ 1460 /* if we are implementing RTS/CTS, toggle that line */
1461 if (tty->termios->c_cflag & CRTSCTS) { 1461 if (tty->termios.c_cflag & CRTSCTS) {
1462 edge_port->shadowMCR &= ~MCR_RTS; 1462 edge_port->shadowMCR &= ~MCR_RTS;
1463 status = send_cmd_write_uart_register(edge_port, MCR, 1463 status = send_cmd_write_uart_register(edge_port, MCR,
1464 edge_port->shadowMCR); 1464 edge_port->shadowMCR);
@@ -1497,7 +1497,7 @@ static void edge_unthrottle(struct tty_struct *tty)
1497 return; 1497 return;
1498 } 1498 }
1499 /* if we are implementing RTS/CTS, toggle that line */ 1499 /* if we are implementing RTS/CTS, toggle that line */
1500 if (tty->termios->c_cflag & CRTSCTS) { 1500 if (tty->termios.c_cflag & CRTSCTS) {
1501 edge_port->shadowMCR |= MCR_RTS; 1501 edge_port->shadowMCR |= MCR_RTS;
1502 send_cmd_write_uart_register(edge_port, MCR, 1502 send_cmd_write_uart_register(edge_port, MCR,
1503 edge_port->shadowMCR); 1503 edge_port->shadowMCR);
@@ -1516,9 +1516,9 @@ static void edge_set_termios(struct tty_struct *tty,
1516 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 1516 struct edgeport_port *edge_port = usb_get_serial_port_data(port);
1517 unsigned int cflag; 1517 unsigned int cflag;
1518 1518
1519 cflag = tty->termios->c_cflag; 1519 cflag = tty->termios.c_cflag;
1520 dbg("%s - clfag %08x iflag %08x", __func__, 1520 dbg("%s - clfag %08x iflag %08x", __func__,
1521 tty->termios->c_cflag, tty->termios->c_iflag); 1521 tty->termios.c_cflag, tty->termios.c_iflag);
1522 dbg("%s - old clfag %08x old iflag %08x", __func__, 1522 dbg("%s - old clfag %08x old iflag %08x", __func__,
1523 old_termios->c_cflag, old_termios->c_iflag); 1523 old_termios->c_cflag, old_termios->c_iflag);
1524 1524
@@ -1987,7 +1987,7 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial,
1987 tty = tty_port_tty_get(&edge_port->port->port); 1987 tty = tty_port_tty_get(&edge_port->port->port);
1988 if (tty) { 1988 if (tty) {
1989 change_port_settings(tty, 1989 change_port_settings(tty,
1990 edge_port, tty->termios); 1990 edge_port, &tty->termios);
1991 tty_kref_put(tty); 1991 tty_kref_put(tty);
1992 } 1992 }
1993 1993
@@ -2570,7 +2570,7 @@ static void change_port_settings(struct tty_struct *tty,
2570 return; 2570 return;
2571 } 2571 }
2572 2572
2573 cflag = tty->termios->c_cflag; 2573 cflag = tty->termios.c_cflag;
2574 2574
2575 switch (cflag & CSIZE) { 2575 switch (cflag & CSIZE) {
2576 case CS5: 2576 case CS5:
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 3936904c6419..765978ae752e 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -1870,7 +1870,7 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
1870 1870
1871 /* set up the port settings */ 1871 /* set up the port settings */
1872 if (tty) 1872 if (tty)
1873 edge_set_termios(tty, port, tty->termios); 1873 edge_set_termios(tty, port, &tty->termios);
1874 1874
1875 /* open up the port */ 1875 /* open up the port */
1876 1876
@@ -2272,13 +2272,13 @@ static void change_port_settings(struct tty_struct *tty,
2272 2272
2273 config = kmalloc (sizeof (*config), GFP_KERNEL); 2273 config = kmalloc (sizeof (*config), GFP_KERNEL);
2274 if (!config) { 2274 if (!config) {
2275 *tty->termios = *old_termios; 2275 tty->termios = *old_termios;
2276 dev_err(&edge_port->port->dev, "%s - out of memory\n", 2276 dev_err(&edge_port->port->dev, "%s - out of memory\n",
2277 __func__); 2277 __func__);
2278 return; 2278 return;
2279 } 2279 }
2280 2280
2281 cflag = tty->termios->c_cflag; 2281 cflag = tty->termios.c_cflag;
2282 2282
2283 config->wFlags = 0; 2283 config->wFlags = 0;
2284 2284
@@ -2362,7 +2362,7 @@ static void change_port_settings(struct tty_struct *tty,
2362 } else 2362 } else
2363 dbg("%s - OUTBOUND XON/XOFF is disabled", __func__); 2363 dbg("%s - OUTBOUND XON/XOFF is disabled", __func__);
2364 2364
2365 tty->termios->c_cflag &= ~CMSPAR; 2365 tty->termios.c_cflag &= ~CMSPAR;
2366 2366
2367 /* Round the baud rate */ 2367 /* Round the baud rate */
2368 baud = tty_get_baud_rate(tty); 2368 baud = tty_get_baud_rate(tty);
@@ -2408,10 +2408,10 @@ static void edge_set_termios(struct tty_struct *tty,
2408 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 2408 struct edgeport_port *edge_port = usb_get_serial_port_data(port);
2409 unsigned int cflag; 2409 unsigned int cflag;
2410 2410
2411 cflag = tty->termios->c_cflag; 2411 cflag = tty->termios.c_cflag;
2412 2412
2413 dbg("%s - clfag %08x iflag %08x", __func__, 2413 dbg("%s - clfag %08x iflag %08x", __func__,
2414 tty->termios->c_cflag, tty->termios->c_iflag); 2414 tty->termios.c_cflag, tty->termios.c_iflag);
2415 dbg("%s - old clfag %08x old iflag %08x", __func__, 2415 dbg("%s - old clfag %08x old iflag %08x", __func__,
2416 old_termios->c_cflag, old_termios->c_iflag); 2416 old_termios->c_cflag, old_termios->c_iflag);
2417 dbg("%s - port %d", __func__, port->number); 2417 dbg("%s - port %d", __func__, port->number);
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index fc09414c960f..5a96692b12a2 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -381,7 +381,7 @@ static void ir_set_termios(struct tty_struct *tty,
381 ir_xbof = ir_xbof_change(xbof) ; 381 ir_xbof = ir_xbof_change(xbof) ;
382 382
383 /* Only speed changes are supported */ 383 /* Only speed changes are supported */
384 tty_termios_copy_hw(tty->termios, old_termios); 384 tty_termios_copy_hw(&tty->termios, old_termios);
385 tty_encode_baud_rate(tty, baud, baud); 385 tty_encode_baud_rate(tty, baud, baud);
386 386
387 /* 387 /*
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index 22b1eb5040b7..bf3864045c18 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -921,7 +921,7 @@ static void iuu_set_termios(struct tty_struct *tty,
921{ 921{
922 const u32 supported_mask = CMSPAR|PARENB|PARODD; 922 const u32 supported_mask = CMSPAR|PARENB|PARODD;
923 struct iuu_private *priv = usb_get_serial_port_data(port); 923 struct iuu_private *priv = usb_get_serial_port_data(port);
924 unsigned int cflag = tty->termios->c_cflag; 924 unsigned int cflag = tty->termios.c_cflag;
925 int status; 925 int status;
926 u32 actual; 926 u32 actual;
927 u32 parity; 927 u32 parity;
@@ -930,7 +930,7 @@ static void iuu_set_termios(struct tty_struct *tty,
930 u32 newval = cflag & supported_mask; 930 u32 newval = cflag & supported_mask;
931 931
932 /* Just use the ospeed. ispeed should be the same. */ 932 /* Just use the ospeed. ispeed should be the same. */
933 baud = tty->termios->c_ospeed; 933 baud = tty->termios.c_ospeed;
934 934
935 dbg("%s - enter c_ospeed or baud=%d", __func__, baud); 935 dbg("%s - enter c_ospeed or baud=%d", __func__, baud);
936 936
@@ -961,13 +961,13 @@ static void iuu_set_termios(struct tty_struct *tty,
961 * settings back over and then adjust them 961 * settings back over and then adjust them
962 */ 962 */
963 if (old_termios) 963 if (old_termios)
964 tty_termios_copy_hw(tty->termios, old_termios); 964 tty_termios_copy_hw(&tty->termios, old_termios);
965 if (status != 0) /* Set failed - return old bits */ 965 if (status != 0) /* Set failed - return old bits */
966 return; 966 return;
967 /* Re-encode speed, parity and csize */ 967 /* Re-encode speed, parity and csize */
968 tty_encode_baud_rate(tty, baud, baud); 968 tty_encode_baud_rate(tty, baud, baud);
969 tty->termios->c_cflag &= ~(supported_mask|CSIZE); 969 tty->termios.c_cflag &= ~(supported_mask|CSIZE);
970 tty->termios->c_cflag |= newval | csize; 970 tty->termios.c_cflag |= newval | csize;
971} 971}
972 972
973static void iuu_close(struct usb_serial_port *port) 973static void iuu_close(struct usb_serial_port *port)
@@ -993,14 +993,14 @@ static void iuu_close(struct usb_serial_port *port)
993 993
994static void iuu_init_termios(struct tty_struct *tty) 994static void iuu_init_termios(struct tty_struct *tty)
995{ 995{
996 *(tty->termios) = tty_std_termios; 996 tty->termios = tty_std_termios;
997 tty->termios->c_cflag = CLOCAL | CREAD | CS8 | B9600 997 tty->termios.c_cflag = CLOCAL | CREAD | CS8 | B9600
998 | TIOCM_CTS | CSTOPB | PARENB; 998 | TIOCM_CTS | CSTOPB | PARENB;
999 tty->termios->c_ispeed = 9600; 999 tty->termios.c_ispeed = 9600;
1000 tty->termios->c_ospeed = 9600; 1000 tty->termios.c_ospeed = 9600;
1001 tty->termios->c_lflag = 0; 1001 tty->termios.c_lflag = 0;
1002 tty->termios->c_oflag = 0; 1002 tty->termios.c_oflag = 0;
1003 tty->termios->c_iflag = 0; 1003 tty->termios.c_iflag = 0;
1004} 1004}
1005 1005
1006static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port) 1006static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
@@ -1012,8 +1012,8 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
1012 u32 actual; 1012 u32 actual;
1013 struct iuu_private *priv = usb_get_serial_port_data(port); 1013 struct iuu_private *priv = usb_get_serial_port_data(port);
1014 1014
1015 baud = tty->termios->c_ospeed; 1015 baud = tty->termios.c_ospeed;
1016 tty->termios->c_ispeed = baud; 1016 tty->termios.c_ispeed = baud;
1017 /* Re-encode speed */ 1017 /* Re-encode speed */
1018 tty_encode_baud_rate(tty, baud, baud); 1018 tty_encode_baud_rate(tty, baud, baud);
1019 1019
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index a1b99243dac9..6225199119c0 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -158,7 +158,7 @@ static void keyspan_set_termios(struct tty_struct *tty,
158 158
159 p_priv = usb_get_serial_port_data(port); 159 p_priv = usb_get_serial_port_data(port);
160 d_details = p_priv->device_details; 160 d_details = p_priv->device_details;
161 cflag = tty->termios->c_cflag; 161 cflag = tty->termios.c_cflag;
162 device_port = port->number - port->serial->minor; 162 device_port = port->number - port->serial->minor;
163 163
164 /* Baud rate calculation takes baud rate as an integer 164 /* Baud rate calculation takes baud rate as an integer
@@ -179,7 +179,7 @@ static void keyspan_set_termios(struct tty_struct *tty,
179 p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none; 179 p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none;
180 180
181 /* Mark/Space not supported */ 181 /* Mark/Space not supported */
182 tty->termios->c_cflag &= ~CMSPAR; 182 tty->termios.c_cflag &= ~CMSPAR;
183 183
184 keyspan_send_setup(port, 0); 184 keyspan_send_setup(port, 0);
185} 185}
@@ -1089,7 +1089,7 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port)
1089 1089
1090 device_port = port->number - port->serial->minor; 1090 device_port = port->number - port->serial->minor;
1091 if (tty) { 1091 if (tty) {
1092 cflag = tty->termios->c_cflag; 1092 cflag = tty->termios.c_cflag;
1093 /* Baud rate calculation takes baud rate as an integer 1093 /* Baud rate calculation takes baud rate as an integer
1094 so other rates can be generated if desired. */ 1094 so other rates can be generated if desired. */
1095 baud_rate = tty_get_baud_rate(tty); 1095 baud_rate = tty_get_baud_rate(tty);
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index a4ac3cfeffc4..dcada8615fcf 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -338,7 +338,7 @@ static void keyspan_pda_set_termios(struct tty_struct *tty,
338 7[EOMS]1: 10 bit, b0/b7 is parity 338 7[EOMS]1: 10 bit, b0/b7 is parity
339 7[EOMS]2: 11 bit, b0/b7 is parity, extra bit always (mark?) 339 7[EOMS]2: 11 bit, b0/b7 is parity, extra bit always (mark?)
340 340
341 HW flow control is dictated by the tty->termios->c_cflags & CRTSCTS 341 HW flow control is dictated by the tty->termios.c_cflags & CRTSCTS
342 bit. 342 bit.
343 343
344 For now, just do baud. */ 344 For now, just do baud. */
@@ -353,7 +353,7 @@ static void keyspan_pda_set_termios(struct tty_struct *tty,
353 } 353 }
354 /* Only speed can change so copy the old h/w parameters 354 /* Only speed can change so copy the old h/w parameters
355 then encode the new speed */ 355 then encode the new speed */
356 tty_termios_copy_hw(tty->termios, old_termios); 356 tty_termios_copy_hw(&tty->termios, old_termios);
357 tty_encode_baud_rate(tty, speed, speed); 357 tty_encode_baud_rate(tty, speed, speed);
358} 358}
359 359
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 5bed59cd5776..def9ad258715 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -311,12 +311,12 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
311 311
312 /* set up termios structure */ 312 /* set up termios structure */
313 spin_lock_irqsave(&priv->lock, flags); 313 spin_lock_irqsave(&priv->lock, flags);
314 priv->termios.c_iflag = tty->termios->c_iflag; 314 priv->termios.c_iflag = tty->termios.c_iflag;
315 priv->termios.c_oflag = tty->termios->c_oflag; 315 priv->termios.c_oflag = tty->termios.c_oflag;
316 priv->termios.c_cflag = tty->termios->c_cflag; 316 priv->termios.c_cflag = tty->termios.c_cflag;
317 priv->termios.c_lflag = tty->termios->c_lflag; 317 priv->termios.c_lflag = tty->termios.c_lflag;
318 for (i = 0; i < NCCS; i++) 318 for (i = 0; i < NCCS; i++)
319 priv->termios.c_cc[i] = tty->termios->c_cc[i]; 319 priv->termios.c_cc[i] = tty->termios.c_cc[i];
320 priv->cfg.pktlen = cfg->pktlen; 320 priv->cfg.pktlen = cfg->pktlen;
321 priv->cfg.baudrate = cfg->baudrate; 321 priv->cfg.baudrate = cfg->baudrate;
322 priv->cfg.databits = cfg->databits; 322 priv->cfg.databits = cfg->databits;
@@ -445,9 +445,9 @@ static void klsi_105_set_termios(struct tty_struct *tty,
445 struct ktermios *old_termios) 445 struct ktermios *old_termios)
446{ 446{
447 struct klsi_105_private *priv = usb_get_serial_port_data(port); 447 struct klsi_105_private *priv = usb_get_serial_port_data(port);
448 unsigned int iflag = tty->termios->c_iflag; 448 unsigned int iflag = tty->termios.c_iflag;
449 unsigned int old_iflag = old_termios->c_iflag; 449 unsigned int old_iflag = old_termios->c_iflag;
450 unsigned int cflag = tty->termios->c_cflag; 450 unsigned int cflag = tty->termios.c_cflag;
451 unsigned int old_cflag = old_termios->c_cflag; 451 unsigned int old_cflag = old_termios->c_cflag;
452 struct klsi_105_port_settings *cfg; 452 struct klsi_105_port_settings *cfg;
453 unsigned long flags; 453 unsigned long flags;
@@ -560,7 +560,7 @@ static void klsi_105_set_termios(struct tty_struct *tty,
560 if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD)) 560 if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD))
561 || (cflag & CSTOPB) != (old_cflag & CSTOPB)) { 561 || (cflag & CSTOPB) != (old_cflag & CSTOPB)) {
562 /* Not currently supported */ 562 /* Not currently supported */
563 tty->termios->c_cflag &= ~(PARENB|PARODD|CSTOPB); 563 tty->termios.c_cflag &= ~(PARENB|PARODD|CSTOPB);
564#if 0 564#if 0
565 priv->last_lcr = 0; 565 priv->last_lcr = 0;
566 566
@@ -587,7 +587,7 @@ static void klsi_105_set_termios(struct tty_struct *tty,
587 || (iflag & IXON) != (old_iflag & IXON) 587 || (iflag & IXON) != (old_iflag & IXON)
588 || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) { 588 || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
589 /* Not currently supported */ 589 /* Not currently supported */
590 tty->termios->c_cflag &= ~CRTSCTS; 590 tty->termios.c_cflag &= ~CRTSCTS;
591 /* Drop DTR/RTS if no flow control otherwise assert */ 591 /* Drop DTR/RTS if no flow control otherwise assert */
592#if 0 592#if 0
593 if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS)) 593 if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS))
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index fafeabb64c55..0516a9661e2f 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -191,11 +191,11 @@ static void kobil_release(struct usb_serial *serial)
191static void kobil_init_termios(struct tty_struct *tty) 191static void kobil_init_termios(struct tty_struct *tty)
192{ 192{
193 /* Default to echo off and other sane device settings */ 193 /* Default to echo off and other sane device settings */
194 tty->termios->c_lflag = 0; 194 tty->termios.c_lflag = 0;
195 tty->termios->c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE); 195 tty->termios.c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE);
196 tty->termios->c_iflag = IGNBRK | IGNPAR | IXOFF; 196 tty->termios.c_lflag = IGNBRK | IGNPAR | IXOFF;
197 /* do NOT translate CR to CR-NL (0x0A -> 0x0A 0x0D) */ 197 /* do NOT translate CR to CR-NL (0x0A -> 0x0A 0x0D) */
198 tty->termios->c_oflag &= ~ONLCR; 198 tty->termios.c_oflag &= ~ONLCR;
199} 199}
200 200
201static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port) 201static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
@@ -581,14 +581,14 @@ static void kobil_set_termios(struct tty_struct *tty,
581 struct kobil_private *priv; 581 struct kobil_private *priv;
582 int result; 582 int result;
583 unsigned short urb_val = 0; 583 unsigned short urb_val = 0;
584 int c_cflag = tty->termios->c_cflag; 584 int c_cflag = tty->termios.c_cflag;
585 speed_t speed; 585 speed_t speed;
586 586
587 priv = usb_get_serial_port_data(port); 587 priv = usb_get_serial_port_data(port);
588 if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID || 588 if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
589 priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) { 589 priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
590 /* This device doesn't support ioctl calls */ 590 /* This device doesn't support ioctl calls */
591 *tty->termios = *old; 591 tty->termios = *old;
592 return; 592 return;
593 } 593 }
594 594
@@ -612,7 +612,7 @@ static void kobil_set_termios(struct tty_struct *tty,
612 urb_val |= SUSBCR_SPASB_EvenParity; 612 urb_val |= SUSBCR_SPASB_EvenParity;
613 } else 613 } else
614 urb_val |= SUSBCR_SPASB_NoParity; 614 urb_val |= SUSBCR_SPASB_NoParity;
615 tty->termios->c_cflag &= ~CMSPAR; 615 tty->termios.c_cflag &= ~CMSPAR;
616 tty_encode_baud_rate(tty, speed, speed); 616 tty_encode_baud_rate(tty, speed, speed);
617 617
618 result = usb_control_msg(port->serial->dev, 618 result = usb_control_msg(port->serial->dev,
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index a71fa0aa0406..df98cffdba65 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -454,7 +454,7 @@ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port)
454 * either. 454 * either.
455 */ 455 */
456 spin_lock_irqsave(&priv->lock, flags); 456 spin_lock_irqsave(&priv->lock, flags);
457 if (tty && (tty->termios->c_cflag & CBAUD)) 457 if (tty && (tty->termios.c_cflag & CBAUD))
458 priv->control_state = TIOCM_DTR | TIOCM_RTS; 458 priv->control_state = TIOCM_DTR | TIOCM_RTS;
459 else 459 else
460 priv->control_state = 0; 460 priv->control_state = 0;
@@ -634,7 +634,7 @@ static void mct_u232_set_termios(struct tty_struct *tty,
634{ 634{
635 struct usb_serial *serial = port->serial; 635 struct usb_serial *serial = port->serial;
636 struct mct_u232_private *priv = usb_get_serial_port_data(port); 636 struct mct_u232_private *priv = usb_get_serial_port_data(port);
637 struct ktermios *termios = tty->termios; 637 struct ktermios *termios = &tty->termios;
638 unsigned int cflag = termios->c_cflag; 638 unsigned int cflag = termios->c_cflag;
639 unsigned int old_cflag = old_termios->c_cflag; 639 unsigned int old_cflag = old_termios->c_cflag;
640 unsigned long flags; 640 unsigned long flags;
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index a07dd3c8cfef..012f67b2e4cc 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1349,7 +1349,7 @@ static void mos7720_throttle(struct tty_struct *tty)
1349 } 1349 }
1350 1350
1351 /* if we are implementing RTS/CTS, toggle that line */ 1351 /* if we are implementing RTS/CTS, toggle that line */
1352 if (tty->termios->c_cflag & CRTSCTS) { 1352 if (tty->termios.c_cflag & CRTSCTS) {
1353 mos7720_port->shadowMCR &= ~UART_MCR_RTS; 1353 mos7720_port->shadowMCR &= ~UART_MCR_RTS;
1354 write_mos_reg(port->serial, port->number - port->serial->minor, 1354 write_mos_reg(port->serial, port->number - port->serial->minor,
1355 MCR, mos7720_port->shadowMCR); 1355 MCR, mos7720_port->shadowMCR);
@@ -1383,7 +1383,7 @@ static void mos7720_unthrottle(struct tty_struct *tty)
1383 } 1383 }
1384 1384
1385 /* if we are implementing RTS/CTS, toggle that line */ 1385 /* if we are implementing RTS/CTS, toggle that line */
1386 if (tty->termios->c_cflag & CRTSCTS) { 1386 if (tty->termios.c_cflag & CRTSCTS) {
1387 mos7720_port->shadowMCR |= UART_MCR_RTS; 1387 mos7720_port->shadowMCR |= UART_MCR_RTS;
1388 write_mos_reg(port->serial, port->number - port->serial->minor, 1388 write_mos_reg(port->serial, port->number - port->serial->minor,
1389 MCR, mos7720_port->shadowMCR); 1389 MCR, mos7720_port->shadowMCR);
@@ -1604,8 +1604,8 @@ static void change_port_settings(struct tty_struct *tty,
1604 lStop = 0x00; /* 1 stop bit */ 1604 lStop = 0x00; /* 1 stop bit */
1605 lParity = 0x00; /* No parity */ 1605 lParity = 0x00; /* No parity */
1606 1606
1607 cflag = tty->termios->c_cflag; 1607 cflag = tty->termios.c_cflag;
1608 iflag = tty->termios->c_iflag; 1608 iflag = tty->termios.c_iflag;
1609 1609
1610 /* Change the number of bits */ 1610 /* Change the number of bits */
1611 switch (cflag & CSIZE) { 1611 switch (cflag & CSIZE) {
@@ -1753,11 +1753,11 @@ static void mos7720_set_termios(struct tty_struct *tty,
1753 1753
1754 dbg("%s\n", "setting termios - ASPIRE"); 1754 dbg("%s\n", "setting termios - ASPIRE");
1755 1755
1756 cflag = tty->termios->c_cflag; 1756 cflag = tty->termios.c_cflag;
1757 1757
1758 dbg("%s - cflag %08x iflag %08x", __func__, 1758 dbg("%s - cflag %08x iflag %08x", __func__,
1759 tty->termios->c_cflag, 1759 tty->termios.c_cflag,
1760 RELEVANT_IFLAG(tty->termios->c_iflag)); 1760 RELEVANT_IFLAG(tty->termios.c_iflag));
1761 1761
1762 dbg("%s - old cflag %08x old iflag %08x", __func__, 1762 dbg("%s - old cflag %08x old iflag %08x", __func__,
1763 old_termios->c_cflag, 1763 old_termios->c_cflag,
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 57eca2448424..d2f2b5d65732 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1649,7 +1649,7 @@ static void mos7840_throttle(struct tty_struct *tty)
1649 return; 1649 return;
1650 } 1650 }
1651 /* if we are implementing RTS/CTS, toggle that line */ 1651 /* if we are implementing RTS/CTS, toggle that line */
1652 if (tty->termios->c_cflag & CRTSCTS) { 1652 if (tty->termios.c_cflag & CRTSCTS) {
1653 mos7840_port->shadowMCR &= ~MCR_RTS; 1653 mos7840_port->shadowMCR &= ~MCR_RTS;
1654 status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, 1654 status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER,
1655 mos7840_port->shadowMCR); 1655 mos7840_port->shadowMCR);
@@ -1692,7 +1692,7 @@ static void mos7840_unthrottle(struct tty_struct *tty)
1692 } 1692 }
1693 1693
1694 /* if we are implementing RTS/CTS, toggle that line */ 1694 /* if we are implementing RTS/CTS, toggle that line */
1695 if (tty->termios->c_cflag & CRTSCTS) { 1695 if (tty->termios.c_cflag & CRTSCTS) {
1696 mos7840_port->shadowMCR |= MCR_RTS; 1696 mos7840_port->shadowMCR |= MCR_RTS;
1697 status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, 1697 status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER,
1698 mos7840_port->shadowMCR); 1698 mos7840_port->shadowMCR);
@@ -1998,8 +1998,8 @@ static void mos7840_change_port_settings(struct tty_struct *tty,
1998 lStop = LCR_STOP_1; 1998 lStop = LCR_STOP_1;
1999 lParity = LCR_PAR_NONE; 1999 lParity = LCR_PAR_NONE;
2000 2000
2001 cflag = tty->termios->c_cflag; 2001 cflag = tty->termios.c_cflag;
2002 iflag = tty->termios->c_iflag; 2002 iflag = tty->termios.c_iflag;
2003 2003
2004 /* Change the number of bits */ 2004 /* Change the number of bits */
2005 if (cflag & CSIZE) { 2005 if (cflag & CSIZE) {
@@ -2159,10 +2159,10 @@ static void mos7840_set_termios(struct tty_struct *tty,
2159 2159
2160 dbg("%s", "setting termios - "); 2160 dbg("%s", "setting termios - ");
2161 2161
2162 cflag = tty->termios->c_cflag; 2162 cflag = tty->termios.c_cflag;
2163 2163
2164 dbg("%s - clfag %08x iflag %08x", __func__, 2164 dbg("%s - clfag %08x iflag %08x", __func__,
2165 tty->termios->c_cflag, RELEVANT_IFLAG(tty->termios->c_iflag)); 2165 tty->termios.c_cflag, RELEVANT_IFLAG(tty->termios.c_iflag));
2166 dbg("%s - old clfag %08x old iflag %08x", __func__, 2166 dbg("%s - old clfag %08x old iflag %08x", __func__,
2167 old_termios->c_cflag, RELEVANT_IFLAG(old_termios->c_iflag)); 2167 old_termios->c_cflag, RELEVANT_IFLAG(old_termios->c_iflag));
2168 dbg("%s - port %d", __func__, port->number); 2168 dbg("%s - port %d", __func__, port->number);
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index 5976b65ab6ee..9f555560bfbf 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -404,10 +404,10 @@ static int oti6858_chars_in_buffer(struct tty_struct *tty)
404 404
405static void oti6858_init_termios(struct tty_struct *tty) 405static void oti6858_init_termios(struct tty_struct *tty)
406{ 406{
407 *(tty->termios) = tty_std_termios; 407 tty->termios = tty_std_termios;
408 tty->termios->c_cflag = B38400 | CS8 | CREAD | HUPCL | CLOCAL; 408 tty->termios.c_cflag = B38400 | CS8 | CREAD | HUPCL | CLOCAL;
409 tty->termios->c_ispeed = 38400; 409 tty->termios.c_ispeed = 38400;
410 tty->termios->c_ospeed = 38400; 410 tty->termios.c_ospeed = 38400;
411} 411}
412 412
413static void oti6858_set_termios(struct tty_struct *tty, 413static void oti6858_set_termios(struct tty_struct *tty,
@@ -425,7 +425,7 @@ static void oti6858_set_termios(struct tty_struct *tty,
425 return; 425 return;
426 } 426 }
427 427
428 cflag = tty->termios->c_cflag; 428 cflag = tty->termios.c_cflag;
429 429
430 spin_lock_irqsave(&priv->lock, flags); 430 spin_lock_irqsave(&priv->lock, flags);
431 divisor = priv->pending_setup.divisor; 431 divisor = priv->pending_setup.divisor;
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 13b8dd6481f5..2b9108a8ea64 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -260,16 +260,16 @@ static void pl2303_set_termios(struct tty_struct *tty,
260 serial settings even to the same values as before. Thus 260 serial settings even to the same values as before. Thus
261 we actually need to filter in this specific case */ 261 we actually need to filter in this specific case */
262 262
263 if (!tty_termios_hw_change(tty->termios, old_termios)) 263 if (!tty_termios_hw_change(&tty->termios, old_termios))
264 return; 264 return;
265 265
266 cflag = tty->termios->c_cflag; 266 cflag = tty->termios.c_cflag;
267 267
268 buf = kzalloc(7, GFP_KERNEL); 268 buf = kzalloc(7, GFP_KERNEL);
269 if (!buf) { 269 if (!buf) {
270 dev_err(&port->dev, "%s - out of memory.\n", __func__); 270 dev_err(&port->dev, "%s - out of memory.\n", __func__);
271 /* Report back no change occurred */ 271 /* Report back no change occurred */
272 *tty->termios = *old_termios; 272 tty->termios = *old_termios;
273 return; 273 return;
274 } 274 }
275 275
diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
index 8dd88ebe9863..7de6d491a859 100644
--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -275,7 +275,7 @@ static void qt2_set_termios(struct tty_struct *tty,
275{ 275{
276 struct usb_device *dev = port->serial->dev; 276 struct usb_device *dev = port->serial->dev;
277 struct qt2_port_private *port_priv; 277 struct qt2_port_private *port_priv;
278 struct ktermios *termios = tty->termios; 278 struct ktermios *termios = &tty->termios;
279 u16 baud; 279 u16 baud;
280 unsigned int cflag = termios->c_cflag; 280 unsigned int cflag = termios->c_cflag;
281 u16 new_lcr = 0; 281 u16 new_lcr = 0;
@@ -408,7 +408,7 @@ static int qt2_open(struct tty_struct *tty, struct usb_serial_port *port)
408 port_priv->device_port = (u8) device_port; 408 port_priv->device_port = (u8) device_port;
409 409
410 if (tty) 410 if (tty)
411 qt2_set_termios(tty, port, tty->termios); 411 qt2_set_termios(tty, port, &tty->termios);
412 412
413 return 0; 413 return 0;
414 414
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index d423d36acc04..a4e4f3a16c63 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -385,7 +385,7 @@ static int sierra_send_setup(struct usb_serial_port *port)
385static void sierra_set_termios(struct tty_struct *tty, 385static void sierra_set_termios(struct tty_struct *tty,
386 struct usb_serial_port *port, struct ktermios *old_termios) 386 struct usb_serial_port *port, struct ktermios *old_termios)
387{ 387{
388 tty_termios_copy_hw(tty->termios, old_termios); 388 tty_termios_copy_hw(&tty->termios, old_termios);
389 sierra_send_setup(port); 389 sierra_send_setup(port);
390} 390}
391 391
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index cad608984710..ab68a4d74d61 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -316,10 +316,10 @@ static void spcp8x5_dtr_rts(struct usb_serial_port *port, int on)
316static void spcp8x5_init_termios(struct tty_struct *tty) 316static void spcp8x5_init_termios(struct tty_struct *tty)
317{ 317{
318 /* for the 1st time call this function */ 318 /* for the 1st time call this function */
319 *(tty->termios) = tty_std_termios; 319 tty->termios = tty_std_termios;
320 tty->termios->c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL; 320 tty->termios.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
321 tty->termios->c_ispeed = 115200; 321 tty->termios.c_ispeed = 115200;
322 tty->termios->c_ospeed = 115200; 322 tty->termios.c_ospeed = 115200;
323} 323}
324 324
325/* set the serial param for transfer. we should check if we really need to 325/* set the serial param for transfer. we should check if we really need to
@@ -330,7 +330,7 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
330 struct usb_serial *serial = port->serial; 330 struct usb_serial *serial = port->serial;
331 struct spcp8x5_private *priv = usb_get_serial_port_data(port); 331 struct spcp8x5_private *priv = usb_get_serial_port_data(port);
332 unsigned long flags; 332 unsigned long flags;
333 unsigned int cflag = tty->termios->c_cflag; 333 unsigned int cflag = tty->termios.c_cflag;
334 unsigned int old_cflag = old_termios->c_cflag; 334 unsigned int old_cflag = old_termios->c_cflag;
335 unsigned short uartdata; 335 unsigned short uartdata;
336 unsigned char buf[2] = {0, 0}; 336 unsigned char buf[2] = {0, 0};
@@ -340,7 +340,7 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
340 340
341 341
342 /* check that they really want us to change something */ 342 /* check that they really want us to change something */
343 if (!tty_termios_hw_change(tty->termios, old_termios)) 343 if (!tty_termios_hw_change(&tty->termios, old_termios))
344 return; 344 return;
345 345
346 /* set DTR/RTS active */ 346 /* set DTR/RTS active */
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index 3fee23bf0c14..cf2d30cf7588 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -216,7 +216,7 @@ static void ssu100_set_termios(struct tty_struct *tty,
216 struct ktermios *old_termios) 216 struct ktermios *old_termios)
217{ 217{
218 struct usb_device *dev = port->serial->dev; 218 struct usb_device *dev = port->serial->dev;
219 struct ktermios *termios = tty->termios; 219 struct ktermios *termios = &tty->termios;
220 u16 baud, divisor, remainder; 220 u16 baud, divisor, remainder;
221 unsigned int cflag = termios->c_cflag; 221 unsigned int cflag = termios->c_cflag;
222 u16 urb_value = 0; /* will hold the new flags */ 222 u16 urb_value = 0; /* will hold the new flags */
@@ -322,7 +322,7 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port)
322 dbg("%s - set uart failed", __func__); 322 dbg("%s - set uart failed", __func__);
323 323
324 if (tty) 324 if (tty)
325 ssu100_set_termios(tty, port, tty->termios); 325 ssu100_set_termios(tty, port, &tty->termios);
326 326
327 return usb_serial_generic_open(tty, port); 327 return usb_serial_generic_open(tty, port);
328} 328}
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index a4404f5ad68e..f502a16aac21 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -520,7 +520,7 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
520 } 520 }
521 521
522 if (tty) 522 if (tty)
523 ti_set_termios(tty, port, tty->termios); 523 ti_set_termios(tty, port, &tty->termios);
524 524
525 dbg("%s - sending TI_OPEN_PORT", __func__); 525 dbg("%s - sending TI_OPEN_PORT", __func__);
526 status = ti_command_out_sync(tdev, TI_OPEN_PORT, 526 status = ti_command_out_sync(tdev, TI_OPEN_PORT,
@@ -562,7 +562,7 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
562 usb_clear_halt(dev, port->read_urb->pipe); 562 usb_clear_halt(dev, port->read_urb->pipe);
563 563
564 if (tty) 564 if (tty)
565 ti_set_termios(tty, port, tty->termios); 565 ti_set_termios(tty, port, &tty->termios);
566 566
567 dbg("%s - sending TI_OPEN_PORT (2)", __func__); 567 dbg("%s - sending TI_OPEN_PORT (2)", __func__);
568 status = ti_command_out_sync(tdev, TI_OPEN_PORT, 568 status = ti_command_out_sync(tdev, TI_OPEN_PORT,
@@ -831,8 +831,8 @@ static void ti_set_termios(struct tty_struct *tty,
831 int port_number = port->number - port->serial->minor; 831 int port_number = port->number - port->serial->minor;
832 unsigned int mcr; 832 unsigned int mcr;
833 833
834 cflag = tty->termios->c_cflag; 834 cflag = tty->termios.c_cflag;
835 iflag = tty->termios->c_iflag; 835 iflag = tty->termios.c_iflag;
836 836
837 dbg("%s - cflag %08x, iflag %08x", __func__, cflag, iflag); 837 dbg("%s - cflag %08x, iflag %08x", __func__, cflag, iflag);
838 dbg("%s - old clfag %08x, old iflag %08x", __func__, 838 dbg("%s - old clfag %08x, old iflag %08x", __func__,
@@ -871,7 +871,7 @@ static void ti_set_termios(struct tty_struct *tty,
871 } 871 }
872 872
873 /* CMSPAR isn't supported by this driver */ 873 /* CMSPAR isn't supported by this driver */
874 tty->termios->c_cflag &= ~CMSPAR; 874 tty->termios.c_cflag &= ~CMSPAR;
875 875
876 if (cflag & PARENB) { 876 if (cflag & PARENB) {
877 if (cflag & PARODD) { 877 if (cflag & PARODD) {
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index da67abb1945e..5fe21357b55c 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -423,7 +423,7 @@ static void serial_set_termios(struct tty_struct *tty, struct ktermios *old)
423 if (port->serial->type->set_termios) 423 if (port->serial->type->set_termios)
424 port->serial->type->set_termios(tty, port, old); 424 port->serial->type->set_termios(tty, port, old);
425 else 425 else
426 tty_termios_copy_hw(tty->termios, old); 426 tty_termios_copy_hw(&tty->termios, old);
427} 427}
428 428
429static int serial_break(struct tty_struct *tty, int break_state) 429static int serial_break(struct tty_struct *tty, int break_state)
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index f35971dff4a5..7c3db9e6f324 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -67,7 +67,7 @@ void usb_wwan_set_termios(struct tty_struct *tty,
67 struct usb_wwan_intf_private *intfdata = port->serial->private; 67 struct usb_wwan_intf_private *intfdata = port->serial->private;
68 68
69 /* Doesn't support option setting */ 69 /* Doesn't support option setting */
70 tty_termios_copy_hw(tty->termios, old_termios); 70 tty_termios_copy_hw(&tty->termios, old_termios);
71 71
72 if (intfdata->send_setup) 72 if (intfdata->send_setup)
73 intfdata->send_setup(port); 73 intfdata->send_setup(port);
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 473635e7f5db..b36077de72b9 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -724,7 +724,7 @@ static void firm_setup_port(struct tty_struct *tty)
724{ 724{
725 struct usb_serial_port *port = tty->driver_data; 725 struct usb_serial_port *port = tty->driver_data;
726 struct whiteheat_port_settings port_settings; 726 struct whiteheat_port_settings port_settings;
727 unsigned int cflag = tty->termios->c_cflag; 727 unsigned int cflag = tty->termios.c_cflag;
728 728
729 port_settings.port = port->number + 1; 729 port_settings.port = port->number + 1;
730 730