From 7a78e387654f20e798ceab5bae9c1f5557416431 Mon Sep 17 00:00:00 2001 From: Troy Mitchell Date: Tue, 28 Oct 2025 09:32:09 +0800 Subject: [PATCH 1/2] ASoC: spacemit: add failure check for spacemit_i2s_init_dai() Add error handling when memory allocation for dai fails in spacemit_i2s_init_dai() call. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/aPtiNCZ_KBezL2Dr@stanley.mountain/#t Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC") Signed-off-by: Troy Mitchell Closes: tag. It would be easy to make the argument that the Link: https://patch.msgid.link/20251028-fix-k1-i2s-v2-1-a547c15ed5c3@linux.spacemit.com Signed-off-by: Mark Brown --- sound/soc/spacemit/k1_i2s.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c index abc439b53e3d..8af05e1604f5 100644 --- a/sound/soc/spacemit/k1_i2s.c +++ b/sound/soc/spacemit/k1_i2s.c @@ -428,7 +428,9 @@ static int spacemit_i2s_probe(struct platform_device *pdev) dev_set_drvdata(i2s->dev, i2s); - spacemit_i2s_init_dai(i2s, &dai, res->start + SSDATR); + ret = spacemit_i2s_init_dai(i2s, &dai, res->start + SSDATR); + if (ret) + return ret; ret = devm_snd_soc_register_component(i2s->dev, &spacemit_i2s_component, From 66fecfa91deb536a12ddf3d878a99590d7900277 Mon Sep 17 00:00:00 2001 From: Troy Mitchell Date: Tue, 28 Oct 2025 09:32:10 +0800 Subject: [PATCH 2/2] ASoC: spacemit: use `depends on` instead of `select` Selecting DMA_CMA directly bypasses its dependency chain. This can cause build warnings or errors if the required dependencies are not enabled. Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/all/20251022141705.714b19b5@canb.auug.org.au/ Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC") Signed-off-by: Troy Mitchell Link: https://patch.msgid.link/20251028-fix-k1-i2s-v2-2-a547c15ed5c3@linux.spacemit.com Signed-off-by: Mark Brown --- sound/soc/spacemit/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/spacemit/Kconfig b/sound/soc/spacemit/Kconfig index 2179f94f3f17..e11f600a327f 100644 --- a/sound/soc/spacemit/Kconfig +++ b/sound/soc/spacemit/Kconfig @@ -6,8 +6,7 @@ menu "SpacemiT" config SND_SOC_K1_I2S tristate "K1 I2S Device Driver" select SND_SOC_GENERIC_DMAENGINE_PCM - select CMA - select DMA_CMA + depends on DMA_CMA help Say Y or M if you want to add support for I2S driver for K1 I2S controller. The device supports up to maximum of