]> git.baikalelectronics.ru Git - kernel.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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Sep 2011 22:58:01 +0000 (15:58 -0700)
commit337034ce70803f29bffade7d776a05c209152c7d
treeaf48976dd05cf1e1c5d2240e572c32df20a421f3
parent1d9146f0b224410a1a9c69f577274f45b1f86e2a
USB: for usb_autopm_get_interface_async -EINPROGRESS is not an error

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