mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08: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 <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20220616220427.136036-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
7213170a95
commit
ddea4bbf28
@ -714,12 +714,11 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
|
|||||||
struct snd_soc_component *component = mbhc->component;
|
struct snd_soc_component *component = mbhc->component;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(component->dev);
|
ret = pm_runtime_resume_and_get(component->dev);
|
||||||
if (ret < 0 && ret != -EACCES) {
|
if (ret < 0 && ret != -EACCES) {
|
||||||
dev_err_ratelimited(component->dev,
|
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);
|
__func__, ret);
|
||||||
pm_runtime_put_noidle(component->dev);
|
|
||||||
return ret;
|
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);
|
mbhc = container_of(work, struct wcd_mbhc, correct_plug_swch);
|
||||||
component = mbhc->component;
|
component = mbhc->component;
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(component->dev);
|
ret = pm_runtime_resume_and_get(component->dev);
|
||||||
if (ret < 0 && ret != -EACCES) {
|
if (ret < 0 && ret != -EACCES) {
|
||||||
dev_err_ratelimited(component->dev,
|
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);
|
__func__, ret);
|
||||||
pm_runtime_put_noidle(component->dev);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
micbias_mv = wcd_mbhc_get_micbias(mbhc);
|
micbias_mv = wcd_mbhc_get_micbias(mbhc);
|
||||||
|
Loading…
Reference in New Issue
Block a user