Commit d8e11976 authored by Minghao Chi's avatar Minghao Chi Committed by Kalle Valo

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

Using pm_runtime_resume_and_get is more appropriate
for simplifing code
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarMinghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220413093939.2538825-1-chi.minghao@zte.com.cn
parent 3447eebe
......@@ -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]),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment