Skip to content

Commit 05437a9

Browse files
committed
ASoC: mt8192: Report an error if when an invalid sidetone gain is written
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>
1 parent b373076 commit 05437a9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sound/soc/mediatek/mt8192/mt8192-dai-adda.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ static int stf_positive_gain_set(struct snd_kcontrol *kcontrol,
601601
POSITIVE_GAIN_MASK_SFT,
602602
(gain_db / 6) << POSITIVE_GAIN_SFT,
603603
&change);
604+
} else {
605+
return -EINVAL;
604606
}
605607

606608
return change;

0 commit comments

Comments
 (0)