aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/sierra.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 18:04:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 18:04:26 -0400
commit971f115a50afbe409825c9f3399d5a3b9aca4381 (patch)
treecb42dc07a032e325f22b64d961587c081225c6d6 /drivers/usb/serial/sierra.c
parent2e270d84223262a38d4755c61d55f5c73ea89e56 (diff)
parent500132a0f26ad7d9916102193cbc6c1b1becb373 (diff)
Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (172 commits) USB: Add support for SuperSpeed isoc endpoints xhci: Clean up cycle bit math used during stalls. xhci: Fix cycle bit calculation during stall handling. xhci: Update internal dequeue pointers after stalls. USB: Disable auto-suspend for USB 3.0 hubs. USB: Remove bogus USB_PORT_STAT_SUPER_SPEED symbol. xhci: Return canceled URBs immediately when host is halted. xhci: Fixes for suspend/resume of shared HCDs. xhci: Fix re-init on power loss after resume. xhci: Make roothub functions deal with device removal. xhci: Limit roothub ports to 15 USB3 & 31 USB2 ports. xhci: Return a USB 3.0 hub descriptor for USB3 roothub. xhci: Register second xHCI roothub. xhci: Change xhci_find_slot_id_by_port() API. xhci: Refactor bus suspend state into a struct. xhci: Index with a port array instead of PORTSC addresses. USB: Set usb_hcd->state and flags for shared roothubs. usb: Make core allocate resources per PCI-device. usb: Store bus type in usb_hcd, not in driver flags. usb: Change usb_hcd->bandwidth_mutex to a pointer. ...
Diffstat (limited to 'drivers/usb/serial/sierra.c')
-rw-r--r--drivers/usb/serial/sierra.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 0457813eebee..5b88b6836a81 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -376,7 +376,10 @@ static int sierra_send_setup(struct usb_serial_port *port)
376 if (!do_send) 376 if (!do_send)
377 return 0; 377 return 0;
378 378
379 usb_autopm_get_interface(serial->interface); 379 retval = usb_autopm_get_interface(serial->interface);
380 if (retval < 0)
381 return retval;
382
380 retval = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 383 retval = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
381 0x22, 0x21, val, interface, NULL, 0, USB_CTRL_SET_TIMEOUT); 384 0x22, 0x21, val, interface, NULL, 0, USB_CTRL_SET_TIMEOUT);
382 usb_autopm_put_interface(serial->interface); 385 usb_autopm_put_interface(serial->interface);
@@ -811,8 +814,12 @@ static void sierra_close(struct usb_serial_port *port)
811 mutex_lock(&serial->disc_mutex); 814 mutex_lock(&serial->disc_mutex);
812 if (!serial->disconnected) { 815 if (!serial->disconnected) {
813 serial->interface->needs_remote_wakeup = 0; 816 serial->interface->needs_remote_wakeup = 0;
814 usb_autopm_get_interface(serial->interface); 817 /* odd error handling due to pm counters */
815 sierra_send_setup(port); 818 if (!usb_autopm_get_interface(serial->interface))
819 sierra_send_setup(port);
820 else
821 usb_autopm_get_interface_no_resume(serial->interface);
822
816 } 823 }
817 mutex_unlock(&serial->disc_mutex); 824 mutex_unlock(&serial->disc_mutex);
818 spin_lock_irq(&intfdata->susp_lock); 825 spin_lock_irq(&intfdata->susp_lock);
@@ -865,7 +872,8 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
865 /* get rid of everything as in close */ 872 /* get rid of everything as in close */
866 sierra_close(port); 873 sierra_close(port);
867 /* restore balance for autopm */ 874 /* restore balance for autopm */
868 usb_autopm_put_interface(serial->interface); 875 if (!serial->disconnected)
876 usb_autopm_put_interface(serial->interface);
869 return err; 877 return err;
870 } 878 }
871 sierra_send_setup(port); 879 sierra_send_setup(port);