summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2022-11-16 04:07:50 +0100
committerMark Brown <broonie@kernel.org>2022-11-25 20:31:14 +0100
commitd067b3378a78c9c3048ac535e31c171b6f5b5846 (patch)
tree2284f44b48eaff5afb42c7e45090fbc8e9b4c528
parentASoC: dt-bindings: wcd9335: fix reset line polarity in example (diff)
downloadlinux-d067b3378a78c9c3048ac535e31c171b6f5b5846.tar.xz
linux-d067b3378a78c9c3048ac535e31c171b6f5b5846.zip
ASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcvsd_snd
As the mtk_btcvsd_snd_write and mtk_btcvsd_snd_read may return error, it should be better to catch the exception. Fixes: 4bd8597dc36c ("ASoC: mediatek: add btcvsd driver") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Link: https://lore.kernel.org/r/20221116030750.40500-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/mediatek/common/mtk-btcvsd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/mediatek/common/mtk-btcvsd.c b/sound/soc/mediatek/common/mtk-btcvsd.c
index d884bb7c0fc7..1c28b41e4311 100644
--- a/sound/soc/mediatek/common/mtk-btcvsd.c
+++ b/sound/soc/mediatek/common/mtk-btcvsd.c
@@ -1038,11 +1038,9 @@ static int mtk_pcm_btcvsd_copy(struct snd_soc_component *component,
struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(component);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- mtk_btcvsd_snd_write(bt, buf, count);
+ return mtk_btcvsd_snd_write(bt, buf, count);
else
- mtk_btcvsd_snd_read(bt, buf, count);
-
- return 0;
+ return mtk_btcvsd_snd_read(bt, buf, count);
}
/* kcontrol */