mirror of
https://github.com/torvalds/linux.git
synced 2026-12-05 21:04:14 +00:00
ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()
simplify the flow. No functionality change, except that on -EACCESS the reference count will be decreased. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
@@ -714,12 +714,11 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
|
||||
struct snd_soc_component *component = mbhc->component;
|
||||
int ret;
|
||||
|
||||
ret = pm_runtime_get_sync(component->dev);
|
||||
ret = pm_runtime_resume_and_get(component->dev);
|
||||
if (ret < 0 && ret != -EACCES) {
|
||||
dev_err_ratelimited(component->dev,
|
||||
"pm_runtime_get_sync failed in %s, ret %d\n",
|
||||
"pm_runtime_resume_and_get failed in %s, ret %d\n",
|
||||
__func__, ret);
|
||||
pm_runtime_put_noidle(component->dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1097,12 +1096,11 @@ static void wcd_correct_swch_plug(struct work_struct *work)
|
||||
mbhc = container_of(work, struct wcd_mbhc, correct_plug_swch);
|
||||
component = mbhc->component;
|
||||
|
||||
ret = pm_runtime_get_sync(component->dev);
|
||||
ret = pm_runtime_resume_and_get(component->dev);
|
||||
if (ret < 0 && ret != -EACCES) {
|
||||
dev_err_ratelimited(component->dev,
|
||||
"pm_runtime_get_sync failed in %s, ret %d\n",
|
||||
"pm_runtime_resume_and_get failed in %s, ret %d\n",
|
||||
__func__, ret);
|
||||
pm_runtime_put_noidle(component->dev);
|
||||
return;
|
||||
}
|
||||
micbias_mv = wcd_mbhc_get_micbias(mbhc);
|
||||
|
||||
Reference in New Issue
Block a user