diff options
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index ebcc6d0e2e91..a8103e0347ee 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -2195,15 +2195,21 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2195 | 2195 | ||
2196 | /* Set number of data bits, parity, stop bits */ | 2196 | /* Set number of data bits, parity, stop bits */ |
2197 | 2197 | ||
2198 | termios->c_cflag &= ~CMSPAR; | ||
2199 | |||
2200 | urb_value = 0; | 2198 | urb_value = 0; |
2201 | urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : | 2199 | urb_value |= (cflag & CSTOPB ? FTDI_SIO_SET_DATA_STOP_BITS_2 : |
2202 | FTDI_SIO_SET_DATA_STOP_BITS_1); | 2200 | FTDI_SIO_SET_DATA_STOP_BITS_1); |
2203 | urb_value |= (cflag & PARENB ? | 2201 | if (cflag & PARENB) { |
2204 | (cflag & PARODD ? FTDI_SIO_SET_DATA_PARITY_ODD : | 2202 | if (cflag & CMSPAR) |
2205 | FTDI_SIO_SET_DATA_PARITY_EVEN) : | 2203 | urb_value |= cflag & PARODD ? |
2206 | FTDI_SIO_SET_DATA_PARITY_NONE); | 2204 | FTDI_SIO_SET_DATA_PARITY_MARK : |
2205 | FTDI_SIO_SET_DATA_PARITY_SPACE; | ||
2206 | else | ||
2207 | urb_value |= cflag & PARODD ? | ||
2208 | FTDI_SIO_SET_DATA_PARITY_ODD : | ||
2209 | FTDI_SIO_SET_DATA_PARITY_EVEN; | ||
2210 | } else { | ||
2211 | urb_value |= FTDI_SIO_SET_DATA_PARITY_NONE; | ||
2212 | } | ||
2207 | if (cflag & CSIZE) { | 2213 | if (cflag & CSIZE) { |
2208 | switch (cflag & CSIZE) { | 2214 | switch (cflag & CSIZE) { |
2209 | case CS5: urb_value |= 5; dbg("Setting CS5"); break; | 2215 | case CS5: urb_value |= 5; dbg("Setting CS5"); break; |