提交 e116615b 编写于 作者: C Charles Keepax 提交者: Mark Brown

ASoC: wm5110: Use helper function to lock the DAPM mutex

A couple of call sites were missed when the snd_soc_dapm_mutex_lock
function was added this patch fixes those up.
Signed-off-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 3451eb48
...@@ -439,18 +439,17 @@ static int wm5110_in_pga_get(struct snd_kcontrol *kcontrol, ...@@ -439,18 +439,17 @@ static int wm5110_in_pga_get(struct snd_kcontrol *kcontrol,
{ {
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
struct snd_soc_card *card = dapm->card;
int ret; int ret;
/* /*
* PGA Volume is also used as part of the enable sequence, so * PGA Volume is also used as part of the enable sequence, so
* usage of it should be avoided whilst that is running. * usage of it should be avoided whilst that is running.
*/ */
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); snd_soc_dapm_mutex_lock(dapm);
ret = snd_soc_get_volsw_range(kcontrol, ucontrol); ret = snd_soc_get_volsw_range(kcontrol, ucontrol);
mutex_unlock(&card->dapm_mutex); snd_soc_dapm_mutex_unlock(dapm);
return ret; return ret;
} }
...@@ -460,18 +459,17 @@ static int wm5110_in_pga_put(struct snd_kcontrol *kcontrol, ...@@ -460,18 +459,17 @@ static int wm5110_in_pga_put(struct snd_kcontrol *kcontrol,
{ {
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
struct snd_soc_card *card = dapm->card;
int ret; int ret;
/* /*
* PGA Volume is also used as part of the enable sequence, so * PGA Volume is also used as part of the enable sequence, so
* usage of it should be avoided whilst that is running. * usage of it should be avoided whilst that is running.
*/ */
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); snd_soc_dapm_mutex_lock(dapm);
ret = snd_soc_put_volsw_range(kcontrol, ucontrol); ret = snd_soc_put_volsw_range(kcontrol, ucontrol);
mutex_unlock(&card->dapm_mutex); snd_soc_dapm_mutex_unlock(dapm);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册