[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231113153515.751823-1-chentao@kylinos.cn>
Date: Mon, 13 Nov 2023 23:35:15 +0800
From: Kunwu Chan <chentao@...inos.cn>
To: Thinh.Nguyen@...opsys.com, gregkh@...uxfoundation.org,
quic_wcheng@...cinc.com
Cc: kunwu.chan@...mail.com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, Kunwu Chan <chentao@...inos.cn>
Subject: [PATCH] usb: dwc3: Fix an issue that using pm_runtime_get_sync incorrectly
pm_runtime_get_sync() also returns 1 on success.
The documentation for pm_runtime_get_sync() suggests using
pm_runtime_resume_and_get() instead.
Fixes: 77adb8bdf422 ("usb: dwc3: gadget: Allow runtime suspend if UDC unbinded")
Signed-off-by: Kunwu Chan <chentao@...inos.cn>
---
drivers/usb/dwc3/gadget.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 858fe4c299b7..0330de73cd9c 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2745,7 +2745,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
* successful resume, the DWC3 runtime PM resume routine will handle
* the run stop sequence, so avoid duplicate operations here.
*/
- ret = pm_runtime_get_sync(dwc->dev);
+ ret = pm_runtime_resume_and_get(dwc->dev);
if (!ret || ret < 0) {
pm_runtime_put(dwc->dev);
if (ret < 0)
--
2.34.1
Powered by blists - more mailing lists