aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/sierra.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-03-21 07:36:36 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 16:44:18 -0400
commit9c210bfa29dc3845ae61b544f673d9753ffa3618 (patch)
tree4869fba2adf30d76c0681bccab547aa9655e6a11 /drivers/usb/serial/sierra.c
parentbb3529c6a01fce3e23c968982f46fa46a0095345 (diff)
USB: sierra: remove bogus disconnect test in close
Remove bogus (and unnecessary) test for serial->dev being NULL in close. The device is never cleared, and close is never called after a completed disconnect anyway. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/sierra.c')
-rw-r--r--drivers/usb/serial/sierra.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index c13f6e747748..2b06481dc85c 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -778,30 +778,25 @@ static void sierra_close(struct usb_serial_port *port)
778 portdata->rts_state = 0; 778 portdata->rts_state = 0;
779 portdata->dtr_state = 0; 779 portdata->dtr_state = 0;
780 780
781 if (serial->dev) { 781 mutex_lock(&serial->disc_mutex);
782 mutex_lock(&serial->disc_mutex); 782 if (!serial->disconnected) {
783 if (!serial->disconnected) { 783 serial->interface->needs_remote_wakeup = 0;
784 serial->interface->needs_remote_wakeup = 0; 784 /* odd error handling due to pm counters */
785 /* odd error handling due to pm counters */ 785 if (!usb_autopm_get_interface(serial->interface))
786 if (!usb_autopm_get_interface(serial->interface)) 786 sierra_send_setup(port);
787 sierra_send_setup(port); 787 else
788 else 788 usb_autopm_get_interface_no_resume(serial->interface);
789 usb_autopm_get_interface_no_resume(serial->interface);
790
791 }
792 mutex_unlock(&serial->disc_mutex);
793 spin_lock_irq(&intfdata->susp_lock);
794 portdata->opened = 0;
795 spin_unlock_irq(&intfdata->susp_lock);
796 789
790 }
791 mutex_unlock(&serial->disc_mutex);
792 spin_lock_irq(&intfdata->susp_lock);
793 portdata->opened = 0;
794 spin_unlock_irq(&intfdata->susp_lock);
797 795
798 /* Stop reading urbs */ 796 sierra_stop_rx_urbs(port);
799 sierra_stop_rx_urbs(port); 797 for (i = 0; i < portdata->num_in_urbs; i++) {
800 /* .. and release them */ 798 sierra_release_urb(portdata->in_urbs[i]);
801 for (i = 0; i < portdata->num_in_urbs; i++) { 799 portdata->in_urbs[i] = NULL;
802 sierra_release_urb(portdata->in_urbs[i]);
803 portdata->in_urbs[i] = NULL;
804 }
805 } 800 }
806} 801}
807 802