diff mbox series

wlcore: sysfs: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()

Message ID 20220413093431.2538254-1-chi.minghao@zte.com.cn (mailing list archive)
State Accepted
Commit da8e909c99e4525da5ce56814fca5e9cc4a20a63
Delegated to: Kalle Valo
Headers show
Series wlcore: sysfs: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() | expand

Commit Message

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

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/net/wireless/ti/wlcore/sysfs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Kalle Valo April 23, 2022, 7:11 a.m. UTC | #1
cgel.zte@gmail.com wrote:

> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>

Patch applied to wireless-next.git, thanks.

da8e909c99e4 wlcore: sysfs: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wlcore/sysfs.c b/drivers/net/wireless/ti/wlcore/sysfs.c
index 35b535c125b6..f0c7e09b314d 100644
--- a/drivers/net/wireless/ti/wlcore/sysfs.c
+++ b/drivers/net/wireless/ti/wlcore/sysfs.c
@@ -56,11 +56,9 @@  static ssize_t bt_coex_state_store(struct device *dev,
 	if (unlikely(wl->state != WLCORE_STATE_ON))
 		goto out;
 
-	ret = pm_runtime_get_sync(wl->dev);
-	if (ret < 0) {
-		pm_runtime_put_noidle(wl->dev);
+	ret = pm_runtime_resume_and_get(wl->dev);
+	if (ret < 0)
 		goto out;
-	}
 
 	wl1271_acx_sg_enable(wl, wl->sg_enabled);
 	pm_runtime_mark_last_busy(wl->dev);