USB: pl2303: fix DTR/RTS being raised on baud rate change
[linux-flexiantxendom0.git] / drivers / usb / serial / pl2303.c
index ee28115..5532ea5 100644 (file)
@@ -91,6 +91,7 @@ static const struct usb_device_id id_table[] = {
        { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
        { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
        { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) },
+       { USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) },
        { }                                     /* Terminating entry */
 };
 
@@ -359,9 +360,6 @@ static void pl2303_set_termios(struct tty_struct *tty,
                                tmp >>= 2;
                                buf[1] <<= 1;
                        }
-                       if (tmp > 256) {
-                               tmp %= 256;
-                       }
                        buf[0] = tmp;
                }
        }
@@ -423,7 +421,7 @@ static void pl2303_set_termios(struct tty_struct *tty,
        control = priv->line_control;
        if ((cflag & CBAUD) == B0)
                priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS);
-       else
+       else if ((old_termios->c_cflag & CBAUD) == B0)
                priv->line_control |= (CONTROL_DTR | CONTROL_RTS);
        if (control != priv->line_control) {
                control = priv->line_control;