* [PATCH 1/2] ASoC: spacemit: Drop redundant error messages
@ 2026-07-31 10:15 phucduc.bui
2026-07-31 10:15 ` [PATCH 2/2] ASoC: spacemit: init *dp to NULL before error paths phucduc.bui
0 siblings, 1 reply; 2+ messages in thread
From: phucduc.bui @ 2026-07-31 10:15 UTC (permalink / raw)
To: Yixun Lan, Takashi Iwai, Mark Brown, Jaroslav Kysela,
Liam Girdwood
Cc: Troy Mitchell, Goko Mell, Jinmei Wei, Kuninori Morimoto,
linux-riscv, spacemit, linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The called functions already log failures where appropriate. Return the
original error directly and avoid duplicate error messages.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/spacemit/k1_i2s.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c
index cd461f2aa756..64510c9a1a89 100644
--- a/sound/soc/spacemit/k1_i2s.c
+++ b/sound/soc/spacemit/k1_i2s.c
@@ -478,7 +478,7 @@ static int spacemit_i2s_probe(struct platform_device *pdev)
i2s->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(i2s->base))
- return dev_err_probe(i2s->dev, PTR_ERR(i2s->base), "failed to map registers\n");
+ return PTR_ERR(i2s->base);
i2s->reset = devm_reset_control_get_exclusive(&pdev->dev, NULL);
if (IS_ERR(i2s->reset))
@@ -495,7 +495,7 @@ static int spacemit_i2s_probe(struct platform_device *pdev)
&spacemit_i2s_component,
dai, 1);
if (ret)
- return dev_err_probe(i2s->dev, ret, "failed to register component");
+ return ret;
return devm_snd_dmaengine_pcm_register(&pdev->dev, &spacemit_dmaengine_pcm_config, 0);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] ASoC: spacemit: init *dp to NULL before error paths
2026-07-31 10:15 [PATCH 1/2] ASoC: spacemit: Drop redundant error messages phucduc.bui
@ 2026-07-31 10:15 ` phucduc.bui
0 siblings, 0 replies; 2+ messages in thread
From: phucduc.bui @ 2026-07-31 10:15 UTC (permalink / raw)
To: Yixun Lan, Takashi Iwai, Mark Brown, Jaroslav Kysela,
Liam Girdwood
Cc: Troy Mitchell, Goko Mell, Jinmei Wei, Kuninori Morimoto,
linux-riscv, spacemit, linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
spacemit_i2s_init_dai() takes an optional output parameter dp, but only
assigns *dp on the success path. If devm_kmemdup() fails, *dp is left
untouched.
The current caller does check the return value before using dp, so this
isn't an active bug. Still, initialize *dp to NULL upfront as a defensive
measure, consistent with how core helpers like _snd_pcm_new() handle
their optional output parameters.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/spacemit/k1_i2s.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/spacemit/k1_i2s.c b/sound/soc/spacemit/k1_i2s.c
index 64510c9a1a89..23037fa4233c 100644
--- a/sound/soc/spacemit/k1_i2s.c
+++ b/sound/soc/spacemit/k1_i2s.c
@@ -382,6 +382,9 @@ static int spacemit_i2s_init_dai(struct spacemit_i2s_dev *i2s,
struct property *dma_names;
const char *dma_name;
+ if (dp)
+ *dp = NULL;
+
of_property_for_each_string(node, "dma-names", dma_names, dma_name) {
if (!strcmp(dma_name, "tx"))
i2s->has_playback = true;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-31 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 10:15 [PATCH 1/2] ASoC: spacemit: Drop redundant error messages phucduc.bui
2026-07-31 10:15 ` [PATCH 2/2] ASoC: spacemit: init *dp to NULL before error paths phucduc.bui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox