aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/serial/kl5kusb105.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 90e3216abd1f..55736df7d2f4 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -461,17 +461,21 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
461 461
462 dbg("%s port %d", __FUNCTION__, port->number); 462 dbg("%s port %d", __FUNCTION__, port->number);
463 463
464 /* send READ_OFF */ 464 mutex_lock(&port->serial->disc_mutex);
465 rc = usb_control_msg (port->serial->dev, 465 if (!port->serial->disconnected) {
466 usb_sndctrlpipe(port->serial->dev, 0), 466 /* send READ_OFF */
467 KL5KUSB105A_SIO_CONFIGURE, 467 rc = usb_control_msg (port->serial->dev,
468 USB_TYPE_VENDOR | USB_DIR_OUT, 468 usb_sndctrlpipe(port->serial->dev, 0),
469 KL5KUSB105A_SIO_CONFIGURE_READ_OFF, 469 KL5KUSB105A_SIO_CONFIGURE,
470 0, /* index */ 470 USB_TYPE_VENDOR | USB_DIR_OUT,
471 NULL, 0, 471 KL5KUSB105A_SIO_CONFIGURE_READ_OFF,
472 KLSI_TIMEOUT); 472 0, /* index */
473 if (rc < 0) 473 NULL, 0,
474 err("Disabling read failed (error = %d)", rc); 474 KLSI_TIMEOUT);
475 if (rc < 0)
476 err("Disabling read failed (error = %d)", rc);
477 }
478 mutex_unlock(&port->serial->disc_mutex);
475 479
476 /* shutdown our bulk reads and writes */ 480 /* shutdown our bulk reads and writes */
477 usb_kill_urb(port->write_urb); 481 usb_kill_urb(port->write_urb);