diff options
Diffstat (limited to 'drivers/usb/serial/mos7720.c')
-rw-r--r-- | drivers/usb/serial/mos7720.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 725991fadc26..40f3a0188807 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -564,22 +564,25 @@ static void mos7720_close(struct usb_serial_port *port, struct file *filp) | |||
564 | } | 564 | } |
565 | 565 | ||
566 | /* While closing port, shutdown all bulk read, write * | 566 | /* While closing port, shutdown all bulk read, write * |
567 | * and interrupt read if they exists */ | 567 | * and interrupt read if they exists, otherwise nop */ |
568 | if (serial->dev) { | 568 | dbg("Shutdown bulk write"); |
569 | dbg("Shutdown bulk write"); | 569 | usb_kill_urb(port->write_urb); |
570 | usb_kill_urb(port->write_urb); | 570 | dbg("Shutdown bulk read"); |
571 | dbg("Shutdown bulk read"); | 571 | usb_kill_urb(port->read_urb); |
572 | usb_kill_urb(port->read_urb); | 572 | |
573 | mutex_lock(&serial->disc_mutex); | ||
574 | /* these commands must not be issued if the device has | ||
575 | * been disconnected */ | ||
576 | if (!serial->disconnected) { | ||
577 | data = 0x00; | ||
578 | send_mos_cmd(serial, MOS_WRITE, port->number - port->serial->minor, | ||
579 | 0x04, &data); | ||
580 | |||
581 | data = 0x00; | ||
582 | send_mos_cmd(serial, MOS_WRITE, port->number - port->serial->minor, | ||
583 | 0x01, &data); | ||
573 | } | 584 | } |
574 | 585 | mutex_unlock(&serial->disc_mutex); | |
575 | data = 0x00; | ||
576 | send_mos_cmd(serial, MOS_WRITE, port->number - port->serial->minor, | ||
577 | 0x04, &data); | ||
578 | |||
579 | data = 0x00; | ||
580 | send_mos_cmd(serial, MOS_WRITE, port->number - port->serial->minor, | ||
581 | 0x01, &data); | ||
582 | |||
583 | mos7720_port->open = 0; | 586 | mos7720_port->open = 0; |
584 | 587 | ||
585 | dbg("Leaving %s", __FUNCTION__); | 588 | dbg("Leaving %s", __FUNCTION__); |