Skip to content

Commit 8733f99

Browse files
tiwaibroonie
authored andcommitted
ASoC: tlv320dac33: Fix enum ctl accesses in a wrong type
"FIFO Mode" ctl in tlv320dac33 codec driver is 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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 92e963f commit 8733f99

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sound/soc/codecs/tlv320dac33.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol,
446446
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
447447
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
448448

449-
ucontrol->value.integer.value[0] = dac33->fifo_mode;
449+
ucontrol->value.enumerated.item[0] = dac33->fifo_mode;
450450

451451
return 0;
452452
}
@@ -458,17 +458,16 @@ static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol,
458458
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
459459
int ret = 0;
460460

461-
if (dac33->fifo_mode == ucontrol->value.integer.value[0])
461+
if (dac33->fifo_mode == ucontrol->value.enumerated.item[0])
462462
return 0;
463463
/* Do not allow changes while stream is running*/
464464
if (snd_soc_codec_is_active(codec))
465465
return -EPERM;
466466

467-
if (ucontrol->value.integer.value[0] < 0 ||
468-
ucontrol->value.integer.value[0] >= DAC33_FIFO_LAST_MODE)
467+
if (ucontrol->value.enumerated.item[0] >= DAC33_FIFO_LAST_MODE)
469468
ret = -EINVAL;
470469
else
471-
dac33->fifo_mode = ucontrol->value.integer.value[0];
470+
dac33->fifo_mode = ucontrol->value.enumerated.item[0];
472471

473472
return ret;
474473
}

0 commit comments

Comments
 (0)