When using platform data the devm_clk_get() function is
called causing a probe failure if the clock is not
declared. As we can pass the clock handler by platform
data call only devm_clk_get() when platform data is not
used.

Signed-off-by: Jose Abreu <joab...@synopsys.com>
Cc: Carlos Palminha <palmi...@synopsys.com>
Cc: Mark Brown <broo...@kernel.org>
Cc: Liam Girdwood <lgirdw...@gmail.com>
Cc: Jaroslav Kysela <pe...@perex.cz>
Cc: Takashi Iwai <ti...@suse.com>
Cc: Rob Herring <r...@kernel.org>
Cc: Alexey Brodkin <abrod...@synopsys.com>
Cc: linux-snps-...@lists.infradead.org
Cc: alsa-de...@alsa-project.org
Cc: devicet...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---

This patch was only introduced in v7.

 sound/soc/dwc/designware_i2s.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 4c4f0dc..a97be8e 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -690,15 +690,16 @@ static int dw_i2s_probe(struct platform_device *pdev)
                                dev_err(&pdev->dev, "no clock configure 
method\n");
                                return -ENODEV;
                        }
-               }
-               dev->clk = devm_clk_get(&pdev->dev, clk_id);
+               } else {
+                       dev->clk = devm_clk_get(&pdev->dev, clk_id);
 
-               if (IS_ERR(dev->clk))
-                       return PTR_ERR(dev->clk);
+                       if (IS_ERR(dev->clk))
+                               return PTR_ERR(dev->clk);
 
-               ret = clk_prepare_enable(dev->clk);
-               if (ret < 0)
-                       return ret;
+                       ret = clk_prepare_enable(dev->clk);
+                       if (ret < 0)
+                               return ret;
+               }
        }
 
        dev_set_drvdata(&pdev->dev, dev);
-- 
1.9.1


Reply via email to