diff options
| -rw-r--r-- | drivers/usb/serial/sierra.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 3ec79dfc41fd..5019325ba25d 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
| @@ -777,8 +777,11 @@ static void sierra_close(struct usb_serial_port *port) | |||
| 777 | 777 | ||
| 778 | if (serial->dev) { | 778 | if (serial->dev) { |
| 779 | mutex_lock(&serial->disc_mutex); | 779 | mutex_lock(&serial->disc_mutex); |
| 780 | if (!serial->disconnected) | 780 | if (!serial->disconnected) { |
| 781 | serial->interface->needs_remote_wakeup = 0; | ||
| 782 | usb_autopm_get_interface(serial->interface); | ||
| 781 | sierra_send_setup(port); | 783 | sierra_send_setup(port); |
| 784 | } | ||
| 782 | mutex_unlock(&serial->disc_mutex); | 785 | mutex_unlock(&serial->disc_mutex); |
| 783 | spin_lock_irq(&intfdata->susp_lock); | 786 | spin_lock_irq(&intfdata->susp_lock); |
| 784 | portdata->opened = 0; | 787 | portdata->opened = 0; |
| @@ -792,8 +795,6 @@ static void sierra_close(struct usb_serial_port *port) | |||
| 792 | sierra_release_urb(portdata->in_urbs[i]); | 795 | sierra_release_urb(portdata->in_urbs[i]); |
| 793 | portdata->in_urbs[i] = NULL; | 796 | portdata->in_urbs[i] = NULL; |
| 794 | } | 797 | } |
| 795 | usb_autopm_get_interface(serial->interface); | ||
| 796 | serial->interface->needs_remote_wakeup = 0; | ||
| 797 | } | 798 | } |
| 798 | } | 799 | } |
| 799 | 800 | ||
| @@ -831,6 +832,8 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
| 831 | if (err) { | 832 | if (err) { |
| 832 | /* get rid of everything as in close */ | 833 | /* get rid of everything as in close */ |
| 833 | sierra_close(port); | 834 | sierra_close(port); |
| 835 | /* restore balance for autopm */ | ||
| 836 | usb_autopm_put_interface(serial->interface); | ||
| 834 | return err; | 837 | return err; |
| 835 | } | 838 | } |
| 836 | sierra_send_setup(port); | 839 | sierra_send_setup(port); |
| @@ -919,7 +922,7 @@ static void sierra_release(struct usb_serial *serial) | |||
| 919 | #ifdef CONFIG_PM | 922 | #ifdef CONFIG_PM |
| 920 | static void stop_read_write_urbs(struct usb_serial *serial) | 923 | static void stop_read_write_urbs(struct usb_serial *serial) |
| 921 | { | 924 | { |
| 922 | int i, j; | 925 | int i; |
| 923 | struct usb_serial_port *port; | 926 | struct usb_serial_port *port; |
| 924 | struct sierra_port_private *portdata; | 927 | struct sierra_port_private *portdata; |
| 925 | 928 | ||
| @@ -927,8 +930,7 @@ static void stop_read_write_urbs(struct usb_serial *serial) | |||
| 927 | for (i = 0; i < serial->num_ports; ++i) { | 930 | for (i = 0; i < serial->num_ports; ++i) { |
| 928 | port = serial->port[i]; | 931 | port = serial->port[i]; |
| 929 | portdata = usb_get_serial_port_data(port); | 932 | portdata = usb_get_serial_port_data(port); |
| 930 | for (j = 0; j < N_IN_URB; j++) | 933 | sierra_stop_rx_urbs(port); |
| 931 | usb_kill_urb(portdata->in_urbs[j]); | ||
| 932 | usb_kill_anchored_urbs(&portdata->active); | 934 | usb_kill_anchored_urbs(&portdata->active); |
| 933 | } | 935 | } |
| 934 | } | 936 | } |
