diff options
Diffstat (limited to 'drivers/usb/serial/mct_u232.c')
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index b6911757c855..d9c86516fed4 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -499,19 +499,15 @@ static void mct_u232_dtr_rts(struct usb_serial_port *port, int on) | |||
499 | unsigned int control_state; | 499 | unsigned int control_state; |
500 | struct mct_u232_private *priv = usb_get_serial_port_data(port); | 500 | struct mct_u232_private *priv = usb_get_serial_port_data(port); |
501 | 501 | ||
502 | mutex_lock(&port->serial->disc_mutex); | 502 | spin_lock_irq(&priv->lock); |
503 | if (!port->serial->disconnected) { | 503 | if (on) |
504 | /* drop DTR and RTS */ | 504 | priv->control_state |= TIOCM_DTR | TIOCM_RTS; |
505 | spin_lock_irq(&priv->lock); | 505 | else |
506 | if (on) | 506 | priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS); |
507 | priv->control_state |= TIOCM_DTR | TIOCM_RTS; | 507 | control_state = priv->control_state; |
508 | else | 508 | spin_unlock_irq(&priv->lock); |
509 | priv->control_state &= ~(TIOCM_DTR | TIOCM_RTS); | 509 | |
510 | control_state = priv->control_state; | 510 | mct_u232_set_modem_ctrl(port, control_state); |
511 | spin_unlock_irq(&priv->lock); | ||
512 | mct_u232_set_modem_ctrl(port, control_state); | ||
513 | } | ||
514 | mutex_unlock(&port->serial->disc_mutex); | ||
515 | } | 511 | } |
516 | 512 | ||
517 | static void mct_u232_close(struct usb_serial_port *port) | 513 | static void mct_u232_close(struct usb_serial_port *port) |