aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 2c142bb04fe1..90dcc625f70d 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1198,7 +1198,8 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
1198 1198
1199 dbg("%s", __FUNCTION__); 1199 dbg("%s", __FUNCTION__);
1200 1200
1201 if (c_cflag & HUPCL){ 1201 mutex_lock(&port->serial->disc_mutex);
1202 if (c_cflag & HUPCL && !port->serial->disconnected){
1202 /* Disable flow control */ 1203 /* Disable flow control */
1203 if (usb_control_msg(port->serial->dev, 1204 if (usb_control_msg(port->serial->dev,
1204 usb_sndctrlpipe(port->serial->dev, 0), 1205 usb_sndctrlpipe(port->serial->dev, 0),
@@ -1212,6 +1213,7 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
1212 /* drop RTS and DTR */ 1213 /* drop RTS and DTR */
1213 clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 1214 clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
1214 } /* Note change no line if hupcl is off */ 1215 } /* Note change no line if hupcl is off */
1216 mutex_unlock(&port->serial->disc_mutex);
1215 1217
1216 /* cancel any scheduled reading */ 1218 /* cancel any scheduled reading */
1217 cancel_delayed_work(&priv->rx_work); 1219 cancel_delayed_work(&priv->rx_work);