From: Zheng Yongjun Date: Fri, 22 Apr 2022 06:26:52 +0000 (+0000) Subject: usb: dwc3: pci: Fix pm_runtime_get_sync() error checking X-Git-Tag: baikal/aarch64/sdk6.1~3821^2~95 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=8cc1d6fdffd6e2672c2f81ec43a2a051a0b05d0e;p=kernel.git 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: 07976111fff8f ("usb: dwc3: pci: Runtime resume child device from wq") Signed-off-by: Zheng Yongjun Link: https://lore.kernel.org/r/20220422062652.10575-1-zhengyongjun3@huawei.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 33f657d832460..491b5b05d1965 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; }