Skip to content

Commit

Permalink
ASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcv…
Browse files Browse the repository at this point in the history
…sd_snd

[ Upstream commit d067b33 ]

As the mtk_btcvsd_snd_write and mtk_btcvsd_snd_read may return error,
it should be better to catch the exception.

Fixes: 4bd8597 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
JiangJias authored and gregkh committed Dec 31, 2022
1 parent 9d997d6 commit deed956
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sound/soc/mediatek/common/mtk-btcvsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit deed956

Please sign in to comment.