[PATCH 1/3] ASoC: atmel: mchp-spdiftx: Improve probe error handling

From: phucduc . bui

Date: Fri Nov 20 2026 - 04:44:32 EST


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

Use dev_err_probe() when retrieving clocks to avoid logging errors
for deferred probes.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/atmel/mchp-spdiftx.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c
index fc635ed6856e..6ab32f0b8b8e 100644
--- a/sound/soc/atmel/mchp-spdiftx.c
+++ b/sound/soc/atmel/mchp-spdiftx.c
@@ -815,21 +815,15 @@ static int mchp_spdiftx_probe(struct platform_device *pdev)

/* Get the peripheral clock */
dev->pclk = devm_clk_get(&pdev->dev, "pclk");
- if (IS_ERR(dev->pclk)) {
- err = PTR_ERR(dev->pclk);
- dev_err(&pdev->dev,
- "failed to get the peripheral clock: %d\n", err);
- return err;
- }
+ if (IS_ERR(dev->pclk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(dev->pclk),
+ "failed to get the peripheral clock\n");

/* Get the generic clock */
dev->gclk = devm_clk_get(&pdev->dev, "gclk");
- if (IS_ERR(dev->gclk)) {
- err = PTR_ERR(dev->gclk);
- dev_err(&pdev->dev,
- "failed to get the PMC generic clock: %d\n", err);
- return err;
- }
+ if (IS_ERR(dev->gclk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(dev->gclk),
+ "failed to get the PMC generic clock\n");

ctrl = &dev->control;
spin_lock_init(&ctrl->lock);
--
2.43.0