summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/dwc3-pci.c
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2022-04-22 06:26:52 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-23 10:33:52 +0200
commita03e2ddab8e735e2cc315609b297b300e9cc60d2 (patch)
tree3a45927501b0cdaa88f4b4c0590bd4676f6ed091 /drivers/usb/dwc3/dwc3-pci.c
parent4d378f2ae58138d4c55684e1d274e7dd94aa6524 (diff)
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: 8eed00b237a28 ("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>
Diffstat (limited to 'drivers/usb/dwc3/dwc3-pci.c')
-rw-r--r--drivers/usb/dwc3/dwc3-pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 33f657d83246..491b5b05d196 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -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;
}