From: bui duc phuc <[email protected]>

The current device tree binding does not describe the spba clock
as optional. However, the driver currently continues probing when
devm_clk_get() returns an error.

Return -EPROBE_DEFER when the clock provider is not ready, allowing
the driver to retry probing later. Preserve the existing behavior
for other errors.

Fixes: 13b8a97a760e ("ASoC: fsl_asrc: spba clock is needed by asrc device")
Signed-off-by: bui duc phuc <[email protected]>
---
 sound/soc/fsl/fsl_asrc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 055593d5d37b..c91ffb5e0c5e 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -1315,8 +1315,11 @@ static int fsl_asrc_probe(struct platform_device *pdev)
                                     "failed to get ipg clock\n");
 
        asrc->spba_clk = devm_clk_get(&pdev->dev, "spba");
-       if (IS_ERR(asrc->spba_clk))
+       if (IS_ERR(asrc->spba_clk)) {
+               if (PTR_ERR(asrc->spba_clk) == -EPROBE_DEFER)
+                       return -EPROBE_DEFER;
                dev_warn(&pdev->dev, "failed to get spba clock\n");
+       }
 
        for (i = 0; i < ASRC_CLK_MAX_NUM; i++) {
                sprintf(tmp, "asrck_%x", i);
-- 
2.43.0


Reply via email to