* [PATCH v2 0/6] ASoC: samsung: Improve probe error handling
@ 2026-08-12 8:51 phucduc.bui
2026-08-12 8:51 ` [PATCH v2 1/6] ASoC: samsung: aries_wm8994: Preserve gpiod_to_irq() error codes phucduc.bui
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: phucduc.bui @ 2026-08-12 8:51 UTC (permalink / raw)
To: Sylwester Nawrocki, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Cezary Rojewski
Cc: linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Hi all,
This series improves probe error handling in several Samsung ASoC
drivers.
Preserve the original error code from gpiod_to_irq() and use
dev_err_probe() where appropriate. Also remove redundant probe error
messages where the called functions already report the error.
Compile-tested only.
Changes in v2:
- Add Cezary Rojewski's Reviewed-by tag.
- Update the commit message.
Best regards,
Phuc
bui duc phuc (6):
ASoC: samsung: aries_wm8994: Preserve gpiod_to_irq() error codes
ASoC: samsung: aries_wm8994: Drop redundant probe error messages
ASoC: samsung: pcm: Use dev_err_probe() for error handling
ASoC: samsung: pcm: Drop redundant probe error messages
ASoC: samsung: spdif: Drop redundant probe error messages
ASoC: samsung: tm2_wm5110: Drop redundant probe error messages
sound/soc/samsung/aries_wm8994.c | 14 ++++----------
sound/soc/samsung/pcm.c | 19 +++++++------------
sound/soc/samsung/spdif.c | 8 ++------
sound/soc/samsung/tm2_wm5110.c | 12 +++---------
4 files changed, 16 insertions(+), 37 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/6] ASoC: samsung: aries_wm8994: Preserve gpiod_to_irq() error codes
2026-08-12 8:51 [PATCH v2 0/6] ASoC: samsung: Improve probe error handling phucduc.bui
@ 2026-08-12 8:51 ` phucduc.bui
2026-08-12 8:51 ` [PATCH v2 2/6] ASoC: samsung: aries_wm8994: Drop redundant probe error messages phucduc.bui
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-08-12 8:51 UTC (permalink / raw)
To: Sylwester Nawrocki, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Cezary Rojewski
Cc: linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
gpiod_to_irq() can currently return several error codes, including
-ENXIO, -ENODEV, -EPROBE_DEFER, and -EINVAL.
Return the original error code instead of overwriting it with -EINVAL,
so that the actual failure reason is preserved.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Add Cezary Rojewski's Reviewed-by tag.
sound/soc/samsung/aries_wm8994.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c
index 6db91b73f25c..58e3e08225de 100644
--- a/sound/soc/samsung/aries_wm8994.c
+++ b/sound/soc/samsung/aries_wm8994.c
@@ -374,7 +374,7 @@ static int aries_late_probe(struct snd_soc_card *card)
irq = gpiod_to_irq(priv->gpio_headset_detect);
if (irq < 0) {
dev_err(card->dev, "Failed to map headset detect gpio to irq");
- return -EINVAL;
+ return irq;
}
ret = devm_request_threaded_irq(card->dev, irq, NULL,
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/6] ASoC: samsung: aries_wm8994: Drop redundant probe error messages
2026-08-12 8:51 [PATCH v2 0/6] ASoC: samsung: Improve probe error handling phucduc.bui
2026-08-12 8:51 ` [PATCH v2 1/6] ASoC: samsung: aries_wm8994: Preserve gpiod_to_irq() error codes phucduc.bui
@ 2026-08-12 8:51 ` phucduc.bui
2026-08-12 8:51 ` [PATCH v2 3/6] ASoC: samsung: pcm: Use dev_err_probe() for error handling phucduc.bui
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-08-12 8:51 UTC (permalink / raw)
To: Sylwester Nawrocki, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Cezary Rojewski
Cc: linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The functions called here don't log the error themselves, but the
error is already reported deeper in the call chain, so the dev_err()
calls are redundant and can be removed.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Update the commit message.
sound/soc/samsung/aries_wm8994.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c
index 58e3e08225de..d189db96cf17 100644
--- a/sound/soc/samsung/aries_wm8994.c
+++ b/sound/soc/samsung/aries_wm8994.c
@@ -381,10 +381,8 @@ static int aries_late_probe(struct snd_soc_card *card)
headset_det_irq_thread,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
IRQF_ONESHOT, "headset_detect", priv);
- if (ret) {
- dev_err(card->dev, "Failed to request headset detect irq");
+ if (ret)
return ret;
- }
headset_button_gpio[0].data = priv;
headset_button_gpio[0].desc = priv->gpio_headset_key;
@@ -623,10 +621,8 @@ static int aries_audio_probe(struct platform_device *pdev)
if (ret < 0) {
/* Backwards compatible way */
ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing");
- if (ret < 0) {
- dev_err(dev, "Audio routing invalid/unspecified\n");
+ if (ret < 0)
return ret;
- }
}
aries_dai[1].dai_fmt = priv->variant->modem_dai_fmt;
@@ -671,10 +667,8 @@ static int aries_audio_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_component(dev, &aries_component,
aries_ext_dai, ARRAY_SIZE(aries_ext_dai));
- if (ret < 0) {
- dev_err(dev, "Failed to register component: %d\n", ret);
+ if (ret < 0)
goto out;
- }
ret = devm_snd_soc_register_card(dev, card);
if (ret)
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/6] ASoC: samsung: pcm: Use dev_err_probe() for error handling
2026-08-12 8:51 [PATCH v2 0/6] ASoC: samsung: Improve probe error handling phucduc.bui
2026-08-12 8:51 ` [PATCH v2 1/6] ASoC: samsung: aries_wm8994: Preserve gpiod_to_irq() error codes phucduc.bui
2026-08-12 8:51 ` [PATCH v2 2/6] ASoC: samsung: aries_wm8994: Drop redundant probe error messages phucduc.bui
@ 2026-08-12 8:51 ` phucduc.bui
2026-08-12 8:51 ` [PATCH v2 4/6] ASoC: samsung: pcm: Drop redundant probe error messages phucduc.bui
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-08-12 8:51 UTC (permalink / raw)
To: Sylwester Nawrocki, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Cezary Rojewski
Cc: linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Replace dev_err() with dev_err_probe() to prevent log spam when probe
returns -EPROBE_DEFER.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Add Cezary Rojewski's Reviewed-by tag.
sound/soc/samsung/pcm.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 309f024bf2a4..7e7284125c3e 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -499,10 +499,9 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
return PTR_ERR(pcm->regs);
pcm->cclk = devm_clk_get(&pdev->dev, "audio-bus");
- if (IS_ERR(pcm->cclk)) {
- dev_err(&pdev->dev, "failed to get audio-bus clock\n");
- return PTR_ERR(pcm->cclk);
- }
+ if (IS_ERR(pcm->cclk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(pcm->cclk),
+ "failed to get audio-bus clock\n");
ret = clk_prepare_enable(pcm->cclk);
if (ret)
return ret;
@@ -512,8 +511,8 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
pcm->pclk = devm_clk_get(&pdev->dev, "pcm");
if (IS_ERR(pcm->pclk)) {
- dev_err(&pdev->dev, "failed to get pcm clock\n");
- ret = PTR_ERR(pcm->pclk);
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(pcm->pclk),
+ "failed to get pcm clock\n");
goto err_dis_cclk;
}
ret = clk_prepare_enable(pcm->pclk);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/6] ASoC: samsung: pcm: Drop redundant probe error messages
2026-08-12 8:51 [PATCH v2 0/6] ASoC: samsung: Improve probe error handling phucduc.bui
` (2 preceding siblings ...)
2026-08-12 8:51 ` [PATCH v2 3/6] ASoC: samsung: pcm: Use dev_err_probe() for error handling phucduc.bui
@ 2026-08-12 8:51 ` phucduc.bui
2026-08-12 8:51 ` [PATCH v2 5/6] ASoC: samsung: spdif: " phucduc.bui
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-08-12 8:51 UTC (permalink / raw)
To: Sylwester Nawrocki, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Cezary Rojewski
Cc: linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The functions called here don't log the error themselves, but the
error is already reported deeper in the call chain, so the dev_err()
calls are redundant and can be removed.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Update the commit message.
sound/soc/samsung/pcm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 7e7284125c3e..8430686760d7 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -534,19 +534,15 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
NULL, NULL, NULL);
- if (ret) {
- dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
+ if (ret)
goto err_dis_pclk;
- }
pm_runtime_enable(&pdev->dev);
ret = devm_snd_soc_register_component(&pdev->dev, &s3c_pcm_component,
&s3c_pcm_dai[pdev->id], 1);
- if (ret != 0) {
- dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret);
+ if (ret != 0)
goto err_dis_pm;
- }
return 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 5/6] ASoC: samsung: spdif: Drop redundant probe error messages
2026-08-12 8:51 [PATCH v2 0/6] ASoC: samsung: Improve probe error handling phucduc.bui
` (3 preceding siblings ...)
2026-08-12 8:51 ` [PATCH v2 4/6] ASoC: samsung: pcm: Drop redundant probe error messages phucduc.bui
@ 2026-08-12 8:51 ` phucduc.bui
2026-08-12 8:51 ` [PATCH v2 6/6] ASoC: samsung: tm2_wm5110: " phucduc.bui
2026-08-12 9:35 ` [PATCH v2 0/6] ASoC: samsung: Improve probe error handling Cezary Rojewski
6 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-08-12 8:51 UTC (permalink / raw)
To: Sylwester Nawrocki, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Cezary Rojewski
Cc: linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The functions called here don't log the error themselves, but the
error is already reported deeper in the call chain, so the dev_err()
calls are redundant and can be removed.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Update the commit message.
sound/soc/samsung/spdif.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index 53eaabaf8956..719083e8e89d 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -415,19 +415,15 @@ static int spdif_probe(struct platform_device *pdev)
ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
NULL, NULL, NULL);
- if (ret) {
- dev_err(&pdev->dev, "failed to register DMA: %d\n", ret);
+ if (ret)
goto err2;
- }
dev_set_drvdata(&pdev->dev, spdif);
ret = devm_snd_soc_register_component(&pdev->dev,
&samsung_spdif_component, &samsung_spdif_dai, 1);
- if (ret != 0) {
- dev_err(&pdev->dev, "fail to register dai\n");
+ if (ret != 0)
goto err2;
- }
return 0;
err2:
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 6/6] ASoC: samsung: tm2_wm5110: Drop redundant probe error messages
2026-08-12 8:51 [PATCH v2 0/6] ASoC: samsung: Improve probe error handling phucduc.bui
` (4 preceding siblings ...)
2026-08-12 8:51 ` [PATCH v2 5/6] ASoC: samsung: spdif: " phucduc.bui
@ 2026-08-12 8:51 ` phucduc.bui
2026-08-12 9:35 ` [PATCH v2 0/6] ASoC: samsung: Improve probe error handling Cezary Rojewski
6 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-08-12 8:51 UTC (permalink / raw)
To: Sylwester Nawrocki, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Cezary Rojewski
Cc: linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The errors handled here are already reported by the called functions,
either directly or deeper in the call chain. Therefore, the additional
dev_err() calls are redundant and can be removed.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Update the commit message.
sound/soc/samsung/tm2_wm5110.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/sound/soc/samsung/tm2_wm5110.c b/sound/soc/samsung/tm2_wm5110.c
index f1f59e059f5d..f4912826dfd4 100644
--- a/sound/soc/samsung/tm2_wm5110.c
+++ b/sound/soc/samsung/tm2_wm5110.c
@@ -518,19 +518,15 @@ static int tm2_probe(struct platform_device *pdev)
}
ret = snd_soc_of_parse_card_name(card, "model");
- if (ret < 0) {
- dev_err(dev, "Card name is not specified\n");
+ if (ret < 0)
return ret;
- }
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
if (ret < 0) {
/* Backwards compatible way */
ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing");
- if (ret < 0) {
- dev_err(dev, "Audio routing is not specified or invalid\n");
+ if (ret < 0)
return ret;
- }
}
card->aux_dev[0].dlc.of_node = of_parse_phandle(dev->of_node,
@@ -609,10 +605,8 @@ static int tm2_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_component(dev, &tm2_component,
tm2_ext_dai, ARRAY_SIZE(tm2_ext_dai));
- if (ret < 0) {
- dev_err(dev, "Failed to register component: %d\n", ret);
+ if (ret < 0)
goto dai_node_put;
- }
ret = devm_snd_soc_register_card(dev, card);
if (ret < 0) {
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/6] ASoC: samsung: Improve probe error handling
2026-08-12 8:51 [PATCH v2 0/6] ASoC: samsung: Improve probe error handling phucduc.bui
` (5 preceding siblings ...)
2026-08-12 8:51 ` [PATCH v2 6/6] ASoC: samsung: tm2_wm5110: " phucduc.bui
@ 2026-08-12 9:35 ` Cezary Rojewski
6 siblings, 0 replies; 8+ messages in thread
From: Cezary Rojewski @ 2026-08-12 9:35 UTC (permalink / raw)
To: phucduc.bui
Cc: linux-sound, linux-kernel, Sylwester Nawrocki, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai
On 8/12/2026 10:51 AM, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Hi all,
>
> This series improves probe error handling in several Samsung ASoC
> drivers.
>
> Preserve the original error code from gpiod_to_irq() and use
> dev_err_probe() where appropriate. Also remove redundant probe error
> messages where the called functions already report the error.
>
> Compile-tested only.
>
> Changes in v2:
> - Add Cezary Rojewski's Reviewed-by tag.
> - Update the commit message.
Thank you for the update, LGTM:
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-08-12 9:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12 8:51 [PATCH v2 0/6] ASoC: samsung: Improve probe error handling phucduc.bui
2026-08-12 8:51 ` [PATCH v2 1/6] ASoC: samsung: aries_wm8994: Preserve gpiod_to_irq() error codes phucduc.bui
2026-08-12 8:51 ` [PATCH v2 2/6] ASoC: samsung: aries_wm8994: Drop redundant probe error messages phucduc.bui
2026-08-12 8:51 ` [PATCH v2 3/6] ASoC: samsung: pcm: Use dev_err_probe() for error handling phucduc.bui
2026-08-12 8:51 ` [PATCH v2 4/6] ASoC: samsung: pcm: Drop redundant probe error messages phucduc.bui
2026-08-12 8:51 ` [PATCH v2 5/6] ASoC: samsung: spdif: " phucduc.bui
2026-08-12 8:51 ` [PATCH v2 6/6] ASoC: samsung: tm2_wm5110: " phucduc.bui
2026-08-12 9:35 ` [PATCH v2 0/6] ASoC: samsung: Improve probe error handling Cezary Rojewski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.