diff options
| -rw-r--r-- | drivers/usb/serial/ch341.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index d133e72fe888..6279df905c14 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
| @@ -355,7 +355,6 @@ static void ch341_set_termios(struct tty_struct *tty, | |||
| 355 | 355 | ||
| 356 | baud_rate = tty_get_baud_rate(tty); | 356 | baud_rate = tty_get_baud_rate(tty); |
| 357 | 357 | ||
| 358 | priv->baud_rate = baud_rate; | ||
| 359 | ctrl = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX; | 358 | ctrl = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX; |
| 360 | 359 | ||
| 361 | switch (C_CSIZE(tty)) { | 360 | switch (C_CSIZE(tty)) { |
| @@ -388,6 +387,9 @@ static void ch341_set_termios(struct tty_struct *tty, | |||
| 388 | spin_lock_irqsave(&priv->lock, flags); | 387 | spin_lock_irqsave(&priv->lock, flags); |
| 389 | priv->line_control |= (CH341_BIT_DTR | CH341_BIT_RTS); | 388 | priv->line_control |= (CH341_BIT_DTR | CH341_BIT_RTS); |
| 390 | spin_unlock_irqrestore(&priv->lock, flags); | 389 | spin_unlock_irqrestore(&priv->lock, flags); |
| 390 | |||
| 391 | priv->baud_rate = baud_rate; | ||
| 392 | |||
| 391 | r = ch341_init_set_baudrate(port->serial->dev, priv, ctrl); | 393 | r = ch341_init_set_baudrate(port->serial->dev, priv, ctrl); |
| 392 | if (r < 0 && old_termios) { | 394 | if (r < 0 && old_termios) { |
| 393 | priv->baud_rate = tty_termios_baud_rate(old_termios); | 395 | priv->baud_rate = tty_termios_baud_rate(old_termios); |
