diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2022-04-22 09:26:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 19:36:04 +0300 |
commit | c8eb1ea6e839adc7441c8000e51dabb794283cea (patch) | |
tree | 26639a52b7337af5a95a89fbae776ecb5e1138ea /drivers | |
parent | 1c6e5dc3b639c96e6839a8d1b8e951923fdfd34a (diff) | |
download | linux-c8eb1ea6e839adc7441c8000e51dabb794283cea.tar.xz |
usb: dwc3: pci: Fix pm_runtime_get_sync() error checking
[ Upstream commit a03e2ddab8e735e2cc315609b297b300e9cc60d2 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index f08b2178fd32..9c8887615701 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -256,7 +256,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; } |