[PATCH] ASoC: samsung: spdif: Preserve the original clock acquisition error

From: phucduc . bui

Date: Wed Jul 01 2026 - 04:05:50 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

devm_clk_get() may return different error codes, including -EPROBE_DEFER.
The current code overwrites the original error with -ENOENT, preventing
deferred probing from working correctly.
Replace dev_err() with dev_err_probe() so the original error code is
preserved and propagated to the caller.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/samsung/spdif.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index 7fc46d55c522..53eaabaf8956 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -380,8 +380,8 @@ static int spdif_probe(struct platform_device *pdev)

spdif->pclk = devm_clk_get(&pdev->dev, "spdif");
if (IS_ERR(spdif->pclk)) {
- dev_err(&pdev->dev, "failed to get peri-clock\n");
- ret = -ENOENT;
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(spdif->pclk),
+ "failed to get peri-clock\n");
goto err0;
}
ret = clk_prepare_enable(spdif->pclk);
@@ -390,8 +390,8 @@ static int spdif_probe(struct platform_device *pdev)

spdif->sclk = devm_clk_get(&pdev->dev, "sclk_spdif");
if (IS_ERR(spdif->sclk)) {
- dev_err(&pdev->dev, "failed to get internal source clock\n");
- ret = -ENOENT;
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(spdif->sclk),
+ "failed to get internal source clock\n");
goto err1;
}
ret = clk_prepare_enable(spdif->sclk);
--
2.43.0