diff mbox series

[3/4] ASoC: mt8192: Report an error if when an invalid sidetone gain is written

Message ID 20230223-asoc-mt8192-quick-fixes-v1-3-9a85f90368e1@kernel.org (mailing list archive)
State Accepted
Commit 05437a91173b8780692ac35313f98cac68be7c42
Headers show
Series ASoC: mt8192: Fixes from initial glance at kselftest run | expand

Commit Message

Mark Brown Feb. 24, 2023, 2:03 p.m. UTC
Reporting an error on invalid values is optional but helpful to userspace
so do so.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/mediatek/mt8192/mt8192-dai-adda.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Nícolas F. R. A. Prado Feb. 24, 2023, 7:15 p.m. UTC | #1
On Fri, Feb 24, 2023 at 02:03:57PM +0000, Mark Brown wrote:
> Reporting an error on invalid values is optional but helpful to userspace
> so do so.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas
AngeloGioacchino Del Regno Feb. 27, 2023, 8:52 a.m. UTC | #2
Il 24/02/23 15:03, Mark Brown ha scritto:
> Reporting an error on invalid values is optional but helpful to userspace
> so do so.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
diff mbox series

Patch

diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c
index a33d1ce33349..a02a297c0450 100644
--- a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c
+++ b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c
@@ -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;