diff mbox series

usb: musb: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Message ID 20220420090320.2588742-1-chi.minghao@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series usb: musb: using pm_runtime_resume_and_get instead of pm_runtime_get_sync | expand

Commit Message

CGEL April 20, 2022, 9:03 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/usb/musb/musb_core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index f7b1d5993f8c..6f7b37f5fccc 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2828,11 +2828,9 @@  static int musb_suspend(struct device *dev)
 	unsigned long	flags;
 	int ret;
 
-	ret = pm_runtime_get_sync(dev);
-	if (ret < 0) {
-		pm_runtime_put_noidle(dev);
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret < 0)
 		return ret;
-	}
 
 	musb_platform_disable(musb);
 	musb_disable_interrupts(musb);