Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
[sfrench/cifs-2.6.git] / drivers / usb / serial / ch341.c
index 6b252ceb39a828b69b29b78b2dfdfdf572a88bbd..d947d955bceb9504d9beae2d9877ddb41c105e28 100644 (file)
@@ -272,9 +272,6 @@ static void ch341_set_termios(struct usb_serial_port *port,
 
        dbg("ch341_set_termios()");
 
-       if (!tty || !tty->termios)
-               return;
-
        baud_rate = tty_get_baud_rate(tty);
 
        switch (baud_rate) {
@@ -299,6 +296,11 @@ static void ch341_set_termios(struct usb_serial_port *port,
         * (cflag & PARENB) : parity {NONE, EVEN, ODD}
         * (cflag & CSTOPB) : stop bits [1, 2]
         */
+
+        /* Copy back the old hardware settings */
+        tty_termios_copy_hw(tty->termios, old_termios);
+        /* And re-encode with the new baud */
+        tty_encode_baud_rate(tty, baud_rate, baud_rate);
 }
 
 static struct usb_driver ch341_driver = {
@@ -316,9 +318,6 @@ static struct usb_serial_driver ch341_device = {
        },
        .id_table         = id_table,
        .usb_driver       = &ch341_driver,
-       .num_interrupt_in = NUM_DONT_CARE,
-       .num_bulk_in      = 1,
-       .num_bulk_out     = 1,
        .num_ports        = 1,
        .open             = ch341_open,
        .set_termios      = ch341_set_termios,