[PATCH] usb: musb: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

cgel.zte@gmail.com posted 1 patch 4 years, 1 month ago
drivers/usb/musb/musb_core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH] usb: musb: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Posted by cgel.zte@gmail.com 4 years, 1 month ago
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 --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);
-- 
2.25.1