Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: wl1273: Fix enum ctl accesses in a wrong type

"Codec Mode" and "Audio Switch" ctls in wl1273 codec driver are enum,
while the current driver accesses wrongly via value.integer.value[].
They have to be via value.enumerated.item[] instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Takashi Iwai and committed by
Mark Brown
154a0fdd 92e963f5

+6 -7
+6 -7
sound/soc/codecs/wl1273.c
··· 175 175 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 176 176 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 177 177 178 - ucontrol->value.integer.value[0] = wl1273->mode; 178 + ucontrol->value.enumerated.item[0] = wl1273->mode; 179 179 180 180 return 0; 181 181 } ··· 193 193 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); 194 194 struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); 195 195 196 - if (wl1273->mode == ucontrol->value.integer.value[0]) 196 + if (wl1273->mode == ucontrol->value.enumerated.item[0]) 197 197 return 0; 198 198 199 199 /* Do not allow changes while stream is running */ 200 200 if (snd_soc_codec_is_active(codec)) 201 201 return -EPERM; 202 202 203 - if (ucontrol->value.integer.value[0] < 0 || 204 - ucontrol->value.integer.value[0] >= ARRAY_SIZE(wl1273_audio_route)) 203 + if (ucontrol->value.enumerated.item[0] >= ARRAY_SIZE(wl1273_audio_route)) 205 204 return -EINVAL; 206 205 207 - wl1273->mode = ucontrol->value.integer.value[0]; 206 + wl1273->mode = ucontrol->value.enumerated.item[0]; 208 207 209 208 return 1; 210 209 } ··· 218 219 219 220 dev_dbg(codec->dev, "%s: enter.\n", __func__); 220 221 221 - ucontrol->value.integer.value[0] = wl1273->core->audio_mode; 222 + ucontrol->value.enumerated.item[0] = wl1273->core->audio_mode; 222 223 223 224 return 0; 224 225 } ··· 232 233 233 234 dev_dbg(codec->dev, "%s: enter.\n", __func__); 234 235 235 - val = ucontrol->value.integer.value[0]; 236 + val = ucontrol->value.enumerated.item[0]; 236 237 if (wl1273->core->audio_mode == val) 237 238 return 0; 238 239