wlcore: sysfs: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
authorMinghao Chi <chi.minghao@zte.com.cn>
Wed, 13 Apr 2022 09:34:31 +0000 (09:34 +0000)
committerKalle Valo <kvalo@kernel.org>
Sat, 23 Apr 2022 07:11:18 +0000 (10:11 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220413093431.2538254-1-chi.minghao@zte.com.cn
drivers/net/wireless/ti/wlcore/sysfs.c

index 35b535c..f0c7e09 100644 (file)
@@ -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);