ASoC: kirkwood: fix loss of external clock at probe time
authorJean-Francois Moine <moinejf@free.fr>
Sat, 21 Sep 2013 10:00:36 +0000 (12:00 +0200)
committerMark Brown <broonie@linaro.org>
Sat, 21 Sep 2013 13:31:10 +0000 (14:31 +0100)
At probe time, when the clock driver is not yet initialized, the
external clock of the kirkwood sound device will not be usable.

This patch fixes this problem defering the device probe.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/kirkwood/kirkwood-i2s.c

index 0f3d73d4ef48ea72d5d9b3c63d72f90e919ba7bc..3e59af983527ad1d58055d0a51465f80cc7196b8 100644 (file)
@@ -496,7 +496,10 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
                return err;
 
        priv->extclk = devm_clk_get(&pdev->dev, "extclk");
-       if (!IS_ERR(priv->extclk)) {
+       if (IS_ERR(priv->extclk)) {
+               if (PTR_ERR(priv->extclk) == -EPROBE_DEFER)
+                       return -EPROBE_DEFER;
+       } else {
                if (priv->extclk == priv->clk) {
                        devm_clk_put(&pdev->dev, priv->extclk);
                        priv->extclk = ERR_PTR(-EINVAL);