* [PATCH v2 1/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling
2026-07-10 10:21 [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling phucduc.bui
@ 2026-07-10 10:21 ` phucduc.bui
2026-07-10 10:21 ` [PATCH v2 2/3] ASoC: xilinx: xlnx_spdif: Preserve devm_request_irq() error codes phucduc.bui
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-07-10 10:21 UTC (permalink / raw)
To: Vincenzo Frascino, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
Mark Brown, Michal Simek
Cc: linux-sound, linux-kernel, linux-arm-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Use dev_err_probe() for probe error handling where appropriate to
simplify the code and properly handle deferred probe.
Also remove redundant error messages when the called helper already
reports failures, returning the error directly to avoid duplicate
logging.
Reviewed-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Add the Reviewed-by tag.
sound/soc/xilinx/xlnx_i2s.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/sound/soc/xilinx/xlnx_i2s.c b/sound/soc/xilinx/xlnx_i2s.c
index ca915a001ad5..0676da122edd 100644
--- a/sound/soc/xilinx/xlnx_i2s.c
+++ b/sound/soc/xilinx/xlnx_i2s.c
@@ -185,17 +185,15 @@ static int xlnx_i2s_probe(struct platform_device *pdev)
return PTR_ERR(drv_data->base);
ret = of_property_read_u32(node, "xlnx,num-channels", &drv_data->channels);
- if (ret < 0) {
- dev_err(dev, "cannot get supported channels\n");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "cannot get supported channels\n");
+
drv_data->channels *= 2;
ret = of_property_read_u32(node, "xlnx,dwidth", &drv_data->data_width);
- if (ret < 0) {
- dev_err(dev, "cannot get data width\n");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "cannot get data width\n");
+
switch (drv_data->data_width) {
case 16:
format = SNDRV_PCM_FMTBIT_S16_LE;
@@ -233,10 +231,8 @@ static int xlnx_i2s_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_component(&pdev->dev, &xlnx_i2s_component,
&drv_data->dai_drv, 1);
- if (ret) {
- dev_err(&pdev->dev, "i2s component registration failed\n");
+ if (ret)
return ret;
- }
dev_info(&pdev->dev, "%s DAI registered\n", drv_data->dai_drv.name);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 2/3] ASoC: xilinx: xlnx_spdif: Preserve devm_request_irq() error codes
2026-07-10 10:21 [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling phucduc.bui
2026-07-10 10:21 ` [PATCH v2 1/3] " phucduc.bui
@ 2026-07-10 10:21 ` phucduc.bui
2026-07-10 10:21 ` [PATCH v2 3/3] ASoC: xilinx: xlnx_spdif: Use dev_err_probe() and drop redundant error handling phucduc.bui
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-07-10 10:21 UTC (permalink / raw)
To: Vincenzo Frascino, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
Mark Brown, Michal Simek
Cc: linux-sound, linux-kernel, linux-arm-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
devm_request_irq() can return various error codes, such as -EINVAL,
-ENOTCONN, -ENOMEM, -ENOSYS, and -EBUSY. However, the driver
overwrites all of them with -ENODEV, which hides the actual cause of
the failure.
Also, devm_request_irq() already reports failures internally, so the
additional dev_err() call is redundant.
Return the original error code and remove the duplicate error message.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/xilinx/xlnx_spdif.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/xilinx/xlnx_spdif.c b/sound/soc/xilinx/xlnx_spdif.c
index 017a64ab9f1e..deb7225c1b4b 100644
--- a/sound/soc/xilinx/xlnx_spdif.c
+++ b/sound/soc/xilinx/xlnx_spdif.c
@@ -274,10 +274,8 @@ static int xlnx_spdif_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, ret,
xlnx_spdifrx_irq_handler,
0, "XLNX_SPDIF_RX", ctx);
- if (ret) {
- dev_err(dev, "spdif rx irq request failed\n");
- return -ENODEV;
- }
+ if (ret)
+ return ret;
init_waitqueue_head(&ctx->chsts_q);
dai_drv = &xlnx_spdif_rx_dai;
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 3/3] ASoC: xilinx: xlnx_spdif: Use dev_err_probe() and drop redundant error handling
2026-07-10 10:21 [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling phucduc.bui
2026-07-10 10:21 ` [PATCH v2 1/3] " phucduc.bui
2026-07-10 10:21 ` [PATCH v2 2/3] ASoC: xilinx: xlnx_spdif: Preserve devm_request_irq() error codes phucduc.bui
@ 2026-07-10 10:21 ` phucduc.bui
2026-07-10 10:38 ` [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: " Michal Simek
2026-07-10 12:35 ` Mark Brown
4 siblings, 0 replies; 6+ messages in thread
From: phucduc.bui @ 2026-07-10 10:21 UTC (permalink / raw)
To: Vincenzo Frascino, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
Mark Brown, Michal Simek
Cc: linux-sound, linux-kernel, linux-arm-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Use dev_err_probe() for probe error handling where appropriate to
simplify the code and properly handle deferred probe.
Also remove redundant error messages when the called helper already
reports failures, returning the error directly to avoid duplicate
logging.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Adjust line wrapping.
sound/soc/xilinx/xlnx_spdif.c | 25 +++++++++----------------
1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/sound/soc/xilinx/xlnx_spdif.c b/sound/soc/xilinx/xlnx_spdif.c
index deb7225c1b4b..ae05818ba064 100644
--- a/sound/soc/xilinx/xlnx_spdif.c
+++ b/sound/soc/xilinx/xlnx_spdif.c
@@ -249,21 +249,18 @@ static int xlnx_spdif_probe(struct platform_device *pdev)
return -ENOMEM;
ctx->axi_clk = devm_clk_get_enabled(dev, "s_axi_aclk");
- if (IS_ERR(ctx->axi_clk)) {
- ret = PTR_ERR(ctx->axi_clk);
- dev_err(dev, "failed to get s_axi_aclk(%d)\n", ret);
- return ret;
- }
+ if (IS_ERR(ctx->axi_clk))
+ return dev_err_probe(dev, PTR_ERR(ctx->axi_clk),
+ "failed to get s_axi_aclk\n");
ctx->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(ctx->base))
return PTR_ERR(ctx->base);
ret = of_property_read_u32(node, "xlnx,spdif-mode", &ctx->mode);
- if (ret < 0) {
- dev_err(dev, "cannot get SPDIF mode\n");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "cannot get SPDIF mode\n");
+
if (ctx->mode) {
dai_drv = &xlnx_spdif_tx_dai;
} else {
@@ -282,19 +279,15 @@ static int xlnx_spdif_probe(struct platform_device *pdev)
}
ret = of_property_read_u32(node, "xlnx,aud_clk_i", &ctx->aclk);
- if (ret < 0) {
- dev_err(dev, "cannot get aud_clk_i value\n");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "cannot get aud_clk_i value\n");
dev_set_drvdata(dev, ctx);
ret = devm_snd_soc_register_component(dev, &xlnx_spdif_component,
dai_drv, 1);
- if (ret) {
- dev_err(dev, "SPDIF component registration failed\n");
+ if (ret)
return ret;
- }
writel(XSPDIF_SOFT_RESET_VALUE, ctx->base + XSPDIF_SOFT_RESET_REG);
dev_info(dev, "%s DAI registered\n", dai_drv->name);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling
2026-07-10 10:21 [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling phucduc.bui
` (2 preceding siblings ...)
2026-07-10 10:21 ` [PATCH v2 3/3] ASoC: xilinx: xlnx_spdif: Use dev_err_probe() and drop redundant error handling phucduc.bui
@ 2026-07-10 10:38 ` Michal Simek
2026-07-10 12:35 ` Mark Brown
4 siblings, 0 replies; 6+ messages in thread
From: Michal Simek @ 2026-07-10 10:38 UTC (permalink / raw)
To: phucduc.bui, Vincenzo Frascino, Jaroslav Kysela, Takashi Iwai,
Liam Girdwood, Mark Brown
Cc: linux-sound, linux-kernel, linux-arm-kernel
On 7/10/26 12:21, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Hi all,
>
> This series cleans up error handling in the Xilinx ASoC drivers.
> It replaces dev_err() followed by return with dev_err_probe() where
> appropriate in probe paths, allowing deferred probe to be handled
> correctly while simplifying the code.
> It also removes redundant dev_err() calls after helper functions that
> already report failures, avoiding duplicate error messages.
>
> Changes in v2:
> - Split out a separate patch to preserve devm_request_irq() error codes.
> - Adjust line wrapping.
> - Add the Reviewed-by tag.
>
> Best regards,
> Phuc
>
> bui duc phuc (3):
> ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error
> handling
> ASoC: xilinx: xlnx_spdif: Preserve devm_request_irq() error codes
> ASoC: xilinx: xlnx_spdif: Use dev_err_probe() and drop redundant error
> handling
>
> sound/soc/xilinx/xlnx_i2s.c | 18 +++++++-----------
> sound/soc/xilinx/xlnx_spdif.c | 31 +++++++++++--------------------
> 2 files changed, 18 insertions(+), 31 deletions(-)
>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Thanks,
Michal
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling
2026-07-10 10:21 [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling phucduc.bui
` (3 preceding siblings ...)
2026-07-10 10:38 ` [PATCH v2 0/3] ASoC: xilinx: xlnx_i2s: " Michal Simek
@ 2026-07-10 12:35 ` Mark Brown
4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2026-07-10 12:35 UTC (permalink / raw)
To: Vincenzo Frascino, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
Michal Simek, phucduc.bui
Cc: linux-sound, linux-kernel, linux-arm-kernel
On Fri, 10 Jul 2026 17:21:35 +0700, phucduc.bui@gmail.com wrote:
> ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling
>
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Hi all,
>
> This series cleans up error handling in the Xilinx ASoC drivers.
> It replaces dev_err() followed by return with dev_err_probe() where
> appropriate in probe paths, allowing deferred probe to be handled
> correctly while simplifying the code.
> It also removes redundant dev_err() calls after helper functions that
> already report failures, avoiding duplicate error messages.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/3] ASoC: xilinx: xlnx_i2s: Use dev_err_probe() and drop redundant error handling
https://git.kernel.org/broonie/sound/c/14b68141bcff
[2/3] ASoC: xilinx: xlnx_spdif: Preserve devm_request_irq() error codes
https://git.kernel.org/broonie/sound/c/cb32e3acb103
[3/3] ASoC: xilinx: xlnx_spdif: Use dev_err_probe() and drop redundant error handling
https://git.kernel.org/broonie/sound/c/f9620327ba7e
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