diff mbox series

ASoC: mediatek: mt8188-mt6359: Fix error code in codec_init

Message ID f1d2f4c5-895d-4ad3-ab0f-b7ea4a74b69b@moroto.mountain
State Accepted
Commit 1148b42257e2bf30093708398db2c4570ae9fe97
Headers show
Series ASoC: mediatek: mt8188-mt6359: Fix error code in codec_init | expand

Commit Message

Dan Carpenter June 7, 2023, 9:41 a.m. UTC
Return -EINVAL on this error path instead of returning success.

Fixes: 9f08dcbddeb3 ("ASoC: mediatek: mt8188-mt6359: support new board with nau88255")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
This is based on static analysis and not tested.

 sound/soc/mediatek/mt8188/mt8188-mt6359.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
index bc4b74970a46..ae02bbcd5d4e 100644
--- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
+++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
@@ -594,7 +594,7 @@  static int mt8188_max98390_codec_init(struct snd_soc_pcm_runtime *rtd)
 	}
 
 	if (rtd->dai_link->num_codecs <= 2)
-		return ret;
+		return -EINVAL;
 
 	/* add widgets/controls/dapm for rear speakers */
 	ret = snd_soc_dapm_new_controls(&card->dapm, mt8188_rear_spk_widgets,