diff options
author | Mark Brown <broonie@kernel.org> | 2022-05-04 15:30:32 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-05-04 15:30:32 +0100 |
commit | c0b38be14f1d843c29edc763d3df3cc741a2bf10 (patch) | |
tree | 7b4923fbd72134f891faa6866246e16b8a4b30dc /sound/soc/codecs/max98090.c | |
parent | 55d2a66cfec6a4196243940f754f5b34dd2106bf (diff) | |
parent | a962890a5a3cce903ff7c7a19fadee63ed9efdc7 (diff) | |
download | linux-c0b38be14f1d843c29edc763d3df3cc741a2bf10.tar.gz |
ASoC: Pull in fixes
Cleanups for the dmaengine code build on top of current fixes.
Diffstat (limited to 'sound/soc/codecs/max98090.c')
-rw-r--r-- | sound/soc/codecs/max98090.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 4058e147413c..48dcf071bb5a 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -396,6 +396,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, unsigned int sel = ucontrol->value.integer.value[0]; unsigned int val = snd_soc_component_read(component, mc->reg); unsigned int *select; + int change; switch (mc->reg) { case M98090_REG_MIC1_INPUT_LEVEL: @@ -413,6 +414,10 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, val = (val >> mc->shift) & mask; + if (sel < 0 || sel > mc->max) + return -EINVAL; + + change = *select != sel; *select = sel; /* Setting a volume is only valid if it is already On */ @@ -427,7 +432,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, mask << mc->shift, sel << mc->shift); - return 0; + return change; } static const char *max98090_perf_pwr_text[] = |