diff options
| -rw-r--r-- | drivers/usb/serial/ch341.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 5343d65f3b52..eabdd05a2147 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
| @@ -95,6 +95,7 @@ struct ch341_private { | |||
| 95 | unsigned baud_rate; /* set baud rate */ | 95 | unsigned baud_rate; /* set baud rate */ |
| 96 | u8 line_control; /* set line control value RTS/DTR */ | 96 | u8 line_control; /* set line control value RTS/DTR */ |
| 97 | u8 line_status; /* active status of modem control inputs */ | 97 | u8 line_status; /* active status of modem control inputs */ |
| 98 | u8 lcr; | ||
| 98 | }; | 99 | }; |
| 99 | 100 | ||
| 100 | static void ch341_set_termios(struct tty_struct *tty, | 101 | static void ch341_set_termios(struct tty_struct *tty, |
| @@ -232,7 +233,7 @@ static int ch341_configure(struct usb_device *dev, struct ch341_private *priv) | |||
| 232 | if (r < 0) | 233 | if (r < 0) |
| 233 | goto out; | 234 | goto out; |
| 234 | 235 | ||
| 235 | r = ch341_init_set_baudrate(dev, priv, 0); | 236 | r = ch341_init_set_baudrate(dev, priv, priv->lcr); |
| 236 | if (r < 0) | 237 | if (r < 0) |
| 237 | goto out; | 238 | goto out; |
| 238 | 239 | ||
| @@ -397,6 +398,8 @@ static void ch341_set_termios(struct tty_struct *tty, | |||
| 397 | if (r < 0 && old_termios) { | 398 | if (r < 0 && old_termios) { |
| 398 | priv->baud_rate = tty_termios_baud_rate(old_termios); | 399 | priv->baud_rate = tty_termios_baud_rate(old_termios); |
| 399 | tty_termios_copy_hw(&tty->termios, old_termios); | 400 | tty_termios_copy_hw(&tty->termios, old_termios); |
| 401 | } else if (r == 0) { | ||
| 402 | priv->lcr = ctrl; | ||
| 400 | } | 403 | } |
| 401 | } | 404 | } |
| 402 | 405 | ||
