ASoC: mt8192: Report an error if when an invalid sidetone gain is written
authorMark Brown <broonie@kernel.org>
Fri, 24 Feb 2023 14:03:57 +0000 (14:03 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 28 Feb 2023 13:58:54 +0000 (13:58 +0000)
Reporting an error on invalid values is optional but helpful to userspace
so do so.

Reviewed-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230223-asoc-mt8192-quick-fixes-v1-3-9a85f90368e1@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8192/mt8192-dai-adda.c

index a33d1ce..a02a297 100644 (file)
@@ -601,6 +601,8 @@ static int stf_positive_gain_set(struct snd_kcontrol *kcontrol,
                                         POSITIVE_GAIN_MASK_SFT,
                                         (gain_db / 6) << POSITIVE_GAIN_SFT,
                                         &change);
+       } else {
+               return -EINVAL;
        }
 
        return change;