mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 05:48:40 +00:00
usb: dwc3: pci: Fix pm_runtime_get_sync() error checking
If the device is already in a runtime PM enabled state
pm_runtime_get_sync() will return 1, so a test for negative
value should be used to check for errors.
Fixes: 8eed00b237
("usb: dwc3: pci: Runtime resume child device from wq")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20220422062652.10575-1-zhengyongjun3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4d378f2ae5
commit
a03e2ddab8
1 changed files with 1 additions and 1 deletions
|
@ -286,7 +286,7 @@ static void dwc3_pci_resume_work(struct work_struct *work)
|
|||
int ret;
|
||||
|
||||
ret = pm_runtime_get_sync(&dwc3->dev);
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
pm_runtime_put_sync_autosuspend(&dwc3->dev);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue