Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a00cebf5 authored by Peter Rosin's avatar Peter Rosin Committed by Mark Brown
Browse files

ASoC: atmel: tse850: fix off-by-one in the "ANA" enumeration count



At some point I added the "Low" entry at the beginning of the array
without bumping the enumeration count from 9 to 10. Fix this. While at
it, fix the anti-pattern for the other enumeration (used by MUX{1,2}).

Fixes: aa431124 ("ASoC: atmel: tse850: add ASoC driver for the Axentia TSE-850")
Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
parent 61abce13
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -227,7 +227,7 @@ int tse850_put_ana(struct snd_kcontrol *kctrl,
static const char * const mux_text[] = { "Mixer", "Loop" };
static const char * const mux_text[] = { "Mixer", "Loop" };


static const struct soc_enum mux_enum =
static const struct soc_enum mux_enum =
	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, 2, mux_text);
	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(mux_text), mux_text);


static const struct snd_kcontrol_new mux1 =
static const struct snd_kcontrol_new mux1 =
	SOC_DAPM_ENUM_EXT("MUX1", mux_enum, tse850_get_mux1, tse850_put_mux1);
	SOC_DAPM_ENUM_EXT("MUX1", mux_enum, tse850_get_mux1, tse850_put_mux1);
@@ -252,7 +252,7 @@ static const char * const ana_text[] = {
};
};


static const struct soc_enum ana_enum =
static const struct soc_enum ana_enum =
	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, 9, ana_text);
	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(ana_text), ana_text);


static const struct snd_kcontrol_new out =
static const struct snd_kcontrol_new out =
	SOC_DAPM_ENUM_EXT("ANA", ana_enum, tse850_get_ana, tse850_put_ana);
	SOC_DAPM_ENUM_EXT("ANA", ana_enum, tse850_get_ana, tse850_put_ana);