diff options
Diffstat (limited to 'sound/soc/codecs/max98090.c')
-rw-r--r-- | sound/soc/codecs/max98090.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index a5b0c40ee545..b9f15a260c78 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
@@ -419,6 +419,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, | |||
419 | 419 | ||
420 | val = (val >> mc->shift) & mask; | 420 | val = (val >> mc->shift) & mask; |
421 | 421 | ||
422 | if (sel < 0 || sel > mc->max) | ||
423 | return -EINVAL; | ||
424 | |||
422 | *select = sel; | 425 | *select = sel; |
423 | 426 | ||
424 | /* Setting a volume is only valid if it is already On */ | 427 | /* Setting a volume is only valid if it is already On */ |
@@ -433,7 +436,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, | |||
433 | mask << mc->shift, | 436 | mask << mc->shift, |
434 | sel << mc->shift); | 437 | sel << mc->shift); |
435 | 438 | ||
436 | return 0; | 439 | return *select != val; |
437 | } | 440 | } |
438 | 441 | ||
439 | static const char *max98090_perf_pwr_text[] = | 442 | static const char *max98090_perf_pwr_text[] = |