[PATCH 2/2] ASoC: mediatek: common: Propagate PCM buffer errors
From: phucduc . bui
Date: Thu Sep 10 2026 - 07:46:40 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
mtk_afe_pcm_new() currently ignores the return value of
snd_pcm_set_managed_buffer_all().
Return the error to the ASoC core.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/mediatek/common/mtk-afe-platform-driver.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/sound/soc/mediatek/common/mtk-afe-platform-driver.c b/sound/soc/mediatek/common/mtk-afe-platform-driver.c
index c1869b38c9e7..84218d137143 100644
--- a/sound/soc/mediatek/common/mtk-afe-platform-driver.c
+++ b/sound/soc/mediatek/common/mtk-afe-platform-driver.c
@@ -151,11 +151,10 @@ int mtk_afe_pcm_new(struct snd_soc_component *component,
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
size = afe->mtk_afe_hardware->buffer_bytes_max;
- snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, afe->dev,
- afe->preallocate_buffers ? size : 0,
- size);
- return 0;
+ return snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, afe->dev,
+ afe->preallocate_buffers ? size : 0,
+ size);
}
EXPORT_SYMBOL_GPL(mtk_afe_pcm_new);
--
2.43.0