aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJim Wylder <jwylder1@motorola.com>2011-09-06 22:07:20 -0400
committerHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>2011-11-21 12:54:50 -0500
commit9a1c313f62b59a3fc0474c245343ae39665ad42d (patch)
tree00de12167123491a4932e00e7477eaf66a558cd6 /drivers/usb
parent4bf78bdeb3472b6a7d3e9a79a775bf5672980fb8 (diff)
USB: for usb_autopm_get_interface_async -EINPROGRESS is not an error
BugLink: http://bugs.launchpad.net/bugs/890952 commit c5a48592d874ddef8c7880311581eccf0eb30c3b upstream. A return value of -EINPROGRESS from pm_runtime_get indicates that the device is already resuming due to a previous call. Internally, usb_autopm_get_interface_async doesn't treat this as an error and increments the usage count, but passes the error status along to the caller. The logical assumption of the caller is that any negative return value reflects the device not resuming and the pm_usage_cnt not being incremented. Since the usage count is being incremented and the device is resuming, return success (0) instead. Signed-off-by: James Wylder <james.wylder@motorola.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 34e3da5aa72..14b83f2a4e8 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1583,7 +1583,7 @@ int usb_autopm_get_interface_async(struct usb_interface *intf)
1583 dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", 1583 dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
1584 __func__, atomic_read(&intf->dev.power.usage_count), 1584 __func__, atomic_read(&intf->dev.power.usage_count),
1585 status); 1585 status);
1586 if (status > 0) 1586 if (status > 0 || status == -EINPROGRESS)
1587 status = 0; 1587 status = 0;
1588 return status; 1588 return status;
1589} 1589}