]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wlcore: vendor_cmd: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
authorMinghao Chi <chi.minghao@zte.com.cn>
Wed, 13 Apr 2022 09:39:39 +0000 (09:39 +0000)
committerKalle Valo <kvalo@kernel.org>
Sat, 23 Apr 2022 07:11:58 +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/20220413093939.2538825-1-chi.minghao@zte.com.cn
drivers/net/wireless/ti/wlcore/vendor_cmd.c

index e1bd344c4ebc884386062fa52a79e617f7d3c07b..e4269e2b00981e15d02a9563b1f07b482fcf5bd7 100644 (file)
@@ -53,11 +53,9 @@ wlcore_vendor_cmd_smart_config_start(struct wiphy *wiphy,
                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;
-       }
 
        ret = wlcore_smart_config_start(wl,
                        nla_get_u32(tb[WLCORE_VENDOR_ATTR_GROUP_ID]));
@@ -88,11 +86,9 @@ wlcore_vendor_cmd_smart_config_stop(struct wiphy *wiphy,
                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;
-       }
 
        ret = wlcore_smart_config_stop(wl);
 
@@ -135,11 +131,9 @@ wlcore_vendor_cmd_smart_config_set_group_key(struct wiphy *wiphy,
                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;
-       }
 
        ret = wlcore_smart_config_set_group_key(wl,
                        nla_get_u32(tb[WLCORE_VENDOR_ATTR_GROUP_ID]),