diff options
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/ch341.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 6b252ceb39a8..42582d49b69c 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
@@ -272,9 +272,6 @@ static void ch341_set_termios(struct usb_serial_port *port, | |||
272 | 272 | ||
273 | dbg("ch341_set_termios()"); | 273 | dbg("ch341_set_termios()"); |
274 | 274 | ||
275 | if (!tty || !tty->termios) | ||
276 | return; | ||
277 | |||
278 | baud_rate = tty_get_baud_rate(tty); | 275 | baud_rate = tty_get_baud_rate(tty); |
279 | 276 | ||
280 | switch (baud_rate) { | 277 | switch (baud_rate) { |
@@ -299,6 +296,11 @@ static void ch341_set_termios(struct usb_serial_port *port, | |||
299 | * (cflag & PARENB) : parity {NONE, EVEN, ODD} | 296 | * (cflag & PARENB) : parity {NONE, EVEN, ODD} |
300 | * (cflag & CSTOPB) : stop bits [1, 2] | 297 | * (cflag & CSTOPB) : stop bits [1, 2] |
301 | */ | 298 | */ |
299 | |||
300 | /* Copy back the old hardware settings */ | ||
301 | tty_termios_copy_hw(tty->termios, old_termios); | ||
302 | /* And re-encode with the new baud */ | ||
303 | tty_encode_baud_rate(tty, baud_rate, baud_rate); | ||
302 | } | 304 | } |
303 | 305 | ||
304 | static struct usb_driver ch341_driver = { | 306 | static struct usb_driver ch341_driver = { |