[PATCH 1/4] ASoC: atmel: mchp-spdifrx: Improve probe error handling
From: phucduc . bui
Date: Thu Nov 19 2026 - 05:34:51 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-spdifrx.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c
index 63089ac3ebdc..7d80f35576cd 100644
--- a/sound/soc/atmel/mchp-spdifrx.c
+++ b/sound/soc/atmel/mchp-spdifrx.c
@@ -1116,21 +1116,15 @@ static int mchp_spdifrx_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 generated 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 generated 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 generated clock\n");
/*
* Signal control need a valid rate on gclk. hw_params() configures
--
2.43.0