* [PATCH 0/4] ASoC: starfive: Simplify probe error handling
@ 2026-07-23 11:10 phucduc.bui
2026-07-23 11:10 ` [PATCH 1/4] ASoC: starfive: jh7110-pwmdac: Remove unnecessary goto phucduc.bui
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: phucduc.bui @ 2026-07-23 11:10 UTC (permalink / raw)
To: Hal Feng, Xingyu Wu, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: Walker Chen, linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Hi all,
This series cleans up the probe error paths in the StarFive ASoC
drivers by removing unnecessary goto statements and redundant error
messages.
Compile-tested only.
Best regards,
Phuc
bui duc phuc (4):
ASoC: starfive: jh7110-pwmdac: Remove unnecessary goto
ASoC: starfive: jh7110-pwmdac: Drop redundant error messages
ASoC: starfive: jh7110_tdm: Remove unnecessary goto
ASoC: starfive: jh7110_tdm: Drop redundant error messages
sound/soc/starfive/jh7110_pwmdac.c | 15 ++++++---------
sound/soc/starfive/jh7110_tdm.c | 27 ++++++++-------------------
2 files changed, 14 insertions(+), 28 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] ASoC: starfive: jh7110-pwmdac: Remove unnecessary goto
2026-07-23 11:10 [PATCH 0/4] ASoC: starfive: Simplify probe error handling phucduc.bui
@ 2026-07-23 11:10 ` phucduc.bui
2026-07-23 11:10 ` [PATCH 2/4] ASoC: starfive: jh7110-pwmdac: Drop redundant error messages phucduc.bui
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-07-23 11:10 UTC (permalink / raw)
To: Hal Feng, Xingyu Wu, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: Walker Chen, linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The error path after jh7110_pwmdac_runtime_resume() failure only performs a
single cleanup operation before returning. Remove the unnecessary goto
and return directly after calling pm_runtime_disable(), simplifying the
control flow without changing the behavior.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/starfive/jh7110_pwmdac.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/starfive/jh7110_pwmdac.c b/sound/soc/starfive/jh7110_pwmdac.c
index a603dd17931c..562936981cf0 100644
--- a/sound/soc/starfive/jh7110_pwmdac.c
+++ b/sound/soc/starfive/jh7110_pwmdac.c
@@ -486,16 +486,13 @@ static int jh7110_pwmdac_probe(struct platform_device *pdev)
pm_runtime_enable(dev->dev);
if (!pm_runtime_enabled(&pdev->dev)) {
ret = jh7110_pwmdac_runtime_resume(&pdev->dev);
- if (ret)
- goto err_pm_disable;
+ if (ret) {
+ pm_runtime_disable(&pdev->dev);
+ return ret;
+ }
}
return 0;
-
-err_pm_disable:
- pm_runtime_disable(&pdev->dev);
-
- return ret;
}
static void jh7110_pwmdac_remove(struct platform_device *pdev)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] ASoC: starfive: jh7110-pwmdac: Drop redundant error messages
2026-07-23 11:10 [PATCH 0/4] ASoC: starfive: Simplify probe error handling phucduc.bui
2026-07-23 11:10 ` [PATCH 1/4] ASoC: starfive: jh7110-pwmdac: Remove unnecessary goto phucduc.bui
@ 2026-07-23 11:10 ` phucduc.bui
2026-07-23 11:10 ` [PATCH 3/4] ASoC: starfive: jh7110_tdm: Remove unnecessary goto phucduc.bui
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-07-23 11:10 UTC (permalink / raw)
To: Hal Feng, Xingyu Wu, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: Walker Chen, 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/starfive/jh7110_pwmdac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/starfive/jh7110_pwmdac.c b/sound/soc/starfive/jh7110_pwmdac.c
index 562936981cf0..5953c3a4e373 100644
--- a/sound/soc/starfive/jh7110_pwmdac.c
+++ b/sound/soc/starfive/jh7110_pwmdac.c
@@ -477,11 +477,11 @@ static int jh7110_pwmdac_probe(struct platform_device *pdev)
&jh7110_pwmdac_component,
&jh7110_pwmdac_dai, 1);
if (ret)
- return dev_err_probe(&pdev->dev, ret, "failed to register dai\n");
+ return ret;
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
if (ret)
- return dev_err_probe(&pdev->dev, ret, "failed to register pcm\n");
+ return ret;
pm_runtime_enable(dev->dev);
if (!pm_runtime_enabled(&pdev->dev)) {
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] ASoC: starfive: jh7110_tdm: Remove unnecessary goto
2026-07-23 11:10 [PATCH 0/4] ASoC: starfive: Simplify probe error handling phucduc.bui
2026-07-23 11:10 ` [PATCH 1/4] ASoC: starfive: jh7110-pwmdac: Remove unnecessary goto phucduc.bui
2026-07-23 11:10 ` [PATCH 2/4] ASoC: starfive: jh7110-pwmdac: Drop redundant error messages phucduc.bui
@ 2026-07-23 11:10 ` phucduc.bui
2026-07-23 11:10 ` [PATCH 4/4] ASoC: starfive: jh7110_tdm: Drop redundant error messages phucduc.bui
2026-07-30 14:17 ` [PATCH 0/4] ASoC: starfive: Simplify probe error handling Mark Brown
4 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-07-23 11:10 UTC (permalink / raw)
To: Hal Feng, Xingyu Wu, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: Walker Chen, linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The error path after jh7110_tdm_runtime_resume() failure only performs a
single cleanup operation before returning. Remove the unnecessary goto
and return directly after calling pm_runtime_disable(), simplifying the
control flow without changing the behavior.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/starfive/jh7110_tdm.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/starfive/jh7110_tdm.c b/sound/soc/starfive/jh7110_tdm.c
index afdcde7df91a..5365ebe44471 100644
--- a/sound/soc/starfive/jh7110_tdm.c
+++ b/sound/soc/starfive/jh7110_tdm.c
@@ -615,16 +615,13 @@ static int jh7110_tdm_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) {
ret = jh7110_tdm_runtime_resume(&pdev->dev);
- if (ret)
- goto err_pm_disable;
+ if (ret) {
+ pm_runtime_disable(&pdev->dev);
+ return ret;
+ }
}
return 0;
-
-err_pm_disable:
- pm_runtime_disable(&pdev->dev);
-
- return ret;
}
static void jh7110_tdm_dev_remove(struct platform_device *pdev)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/4] ASoC: starfive: jh7110_tdm: Drop redundant error messages
2026-07-23 11:10 [PATCH 0/4] ASoC: starfive: Simplify probe error handling phucduc.bui
` (2 preceding siblings ...)
2026-07-23 11:10 ` [PATCH 3/4] ASoC: starfive: jh7110_tdm: Remove unnecessary goto phucduc.bui
@ 2026-07-23 11:10 ` phucduc.bui
2026-07-30 14:17 ` [PATCH 0/4] ASoC: starfive: Simplify probe error handling Mark Brown
4 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-07-23 11:10 UTC (permalink / raw)
To: Hal Feng, Xingyu Wu, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: Walker Chen, 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/starfive/jh7110_tdm.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/sound/soc/starfive/jh7110_tdm.c b/sound/soc/starfive/jh7110_tdm.c
index 5365ebe44471..f7522bfbe8e6 100644
--- a/sound/soc/starfive/jh7110_tdm.c
+++ b/sound/soc/starfive/jh7110_tdm.c
@@ -559,10 +559,8 @@ static int jh7110_tdm_clk_reset_get(struct platform_device *pdev,
tdm->clks[5].id = "tdm";
ret = devm_clk_bulk_get(&pdev->dev, ARRAY_SIZE(tdm->clks), tdm->clks);
- if (ret) {
- dev_err(&pdev->dev, "Failed to get tdm clocks\n");
+ if (ret)
return ret;
- }
tdm->resets = devm_reset_control_array_get_exclusive(&pdev->dev);
if (IS_ERR(tdm->resets)) {
@@ -589,28 +587,22 @@ static int jh7110_tdm_probe(struct platform_device *pdev)
tdm->dev = &pdev->dev;
ret = jh7110_tdm_clk_reset_get(pdev, tdm);
- if (ret) {
- dev_err(&pdev->dev, "Failed to enable audio-tdm clock\n");
+ if (ret)
return ret;
- }
jh7110_tdm_init_params(tdm);
dev_set_drvdata(&pdev->dev, tdm);
ret = devm_snd_soc_register_component(&pdev->dev, &jh7110_tdm_component,
&jh7110_tdm_dai, 1);
- if (ret) {
- dev_err(&pdev->dev, "Failed to register dai\n");
+ if (ret)
return ret;
- }
ret = devm_snd_dmaengine_pcm_register(&pdev->dev,
&jh7110_dmaengine_pcm_config,
SND_DMAENGINE_PCM_FLAG_COMPAT);
- if (ret) {
- dev_err(&pdev->dev, "Could not register pcm: %d\n", ret);
+ if (ret)
return ret;
- }
pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) {
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] ASoC: starfive: Simplify probe error handling
2026-07-23 11:10 [PATCH 0/4] ASoC: starfive: Simplify probe error handling phucduc.bui
` (3 preceding siblings ...)
2026-07-23 11:10 ` [PATCH 4/4] ASoC: starfive: jh7110_tdm: Drop redundant error messages phucduc.bui
@ 2026-07-30 14:17 ` Mark Brown
4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2026-07-30 14:17 UTC (permalink / raw)
To: Hal Feng, Xingyu Wu, Jaroslav Kysela, Takashi Iwai, phucduc.bui
Cc: Walker Chen, linux-sound, linux-kernel
On Thu, 23 Jul 2026 18:10:10 +0700, phucduc.bui@gmail.com wrote:
> ASoC: starfive: Simplify probe error handling
>
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Hi all,
>
> This series cleans up the probe error paths in the StarFive ASoC
> drivers by removing unnecessary goto statements and redundant error
> messages.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/4] ASoC: starfive: jh7110-pwmdac: Remove unnecessary goto
https://git.kernel.org/broonie/sound/c/65ebc8347a9c
[2/4] ASoC: starfive: jh7110-pwmdac: Drop redundant error messages
https://git.kernel.org/broonie/sound/c/db233669245d
[3/4] ASoC: starfive: jh7110_tdm: Remove unnecessary goto
https://git.kernel.org/broonie/sound/c/de621dacea09
[4/4] ASoC: starfive: jh7110_tdm: Drop redundant error messages
https://git.kernel.org/broonie/sound/c/523c01b12ec1
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-30 15:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-23 11:10 [PATCH 0/4] ASoC: starfive: Simplify probe error handling phucduc.bui
2026-07-23 11:10 ` [PATCH 1/4] ASoC: starfive: jh7110-pwmdac: Remove unnecessary goto phucduc.bui
2026-07-23 11:10 ` [PATCH 2/4] ASoC: starfive: jh7110-pwmdac: Drop redundant error messages phucduc.bui
2026-07-23 11:10 ` [PATCH 3/4] ASoC: starfive: jh7110_tdm: Remove unnecessary goto phucduc.bui
2026-07-23 11:10 ` [PATCH 4/4] ASoC: starfive: jh7110_tdm: Drop redundant error messages phucduc.bui
2026-07-30 14:17 ` [PATCH 0/4] ASoC: starfive: Simplify probe error handling Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®