提交 741338f9 编写于 作者: T Takashi Iwai 提交者: Mark Brown

ASoC: dapm: Fix ctl value accesses in a wrong type

snd_soc_dapm_dai_link_get() and _put() access the associated ctl
values as value.integer.value[].  However, this is an enum ctl, and it
has to be accessed via value.enumerated.item[].  The former is long
while the latter is unsigned int, so they don't align.

Fixes: c6615082 ('ASoC: dapm: add code to configure dai link parameters')
Cc: <stable@vger.kernel.org>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 92e963f5
...@@ -3573,7 +3573,7 @@ static int snd_soc_dapm_dai_link_get(struct snd_kcontrol *kcontrol, ...@@ -3573,7 +3573,7 @@ static int snd_soc_dapm_dai_link_get(struct snd_kcontrol *kcontrol,
{ {
struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol); struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol);
ucontrol->value.integer.value[0] = w->params_select; ucontrol->value.enumerated.item[0] = w->params_select;
return 0; return 0;
} }
...@@ -3587,13 +3587,13 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol, ...@@ -3587,13 +3587,13 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
if (w->power) if (w->power)
return -EBUSY; return -EBUSY;
if (ucontrol->value.integer.value[0] == w->params_select) if (ucontrol->value.enumerated.item[0] == w->params_select)
return 0; return 0;
if (ucontrol->value.integer.value[0] >= w->num_params) if (ucontrol->value.enumerated.item[0] >= w->num_params)
return -EINVAL; return -EINVAL;
w->params_select = ucontrol->value.integer.value[0]; w->params_select = ucontrol->value.enumerated.item[0];
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册