2 Sep
2014
2 Sep
'14
4:56 p.m.
On 09/02/2014 05:27 AM, Xavier Hsu wrote: [...]
+static int wm8971_put_deemph(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
+{
- struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
- struct wm8971_priv *wm8971 = snd_soc_codec_get_drvdata(codec);
- int deemph = ucontrol->value.enumerated.item[0];
- int ret = 0;
- if (deemph > 1)
return -EINVAL;
- mutex_lock(&codec->mutex);
Please use a driver local mutex. The snd_soc_codec mutex is going to be removed sooner or later and we shouldn't add new users.
- if (wm8971->deemph != deemph) {
wm8971->deemph = deemph;
wm8971_set_deemph(codec);
ret = 1;
- }
- mutex_unlock(&codec->mutex);
- return ret;
+}