]> www.infradead.org Git - users/jedix/linux-maple.git/commit
USB: for usb_autopm_get_interface_async -EINPROGRESS is not an error
authorJim Wylder <jwylder1@motorola.com>
Wed, 7 Sep 2011 02:07:20 +0000 (21:07 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 8 Dec 2011 19:17:42 +0000 (11:17 -0800)
commit82e0198f02acb830b37f48fe95500d3bf40881d3
treede3b2dcabca35821bf1444192e806680233ee196
parentc79f3bb74db53a368d0fea00068f610c13030042
USB: for usb_autopm_get_interface_async -EINPROGRESS is not an error

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>
drivers/usb/core/driver.c