ASoC: kirkwood: Free external clock if it is a duplicate of internal
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 4 Aug 2013 19:23:03 +0000 (20:23 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 5 Aug 2013 16:11:12 +0000 (17:11 +0100)
[Remaining patch from "ASoC: kirkwood: use devm_clk_get() for the
external clock" -- broonie]

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/kirkwood/kirkwood-i2s.c

index ba720399536934d6df8f82e2266cd1bbb600d03d..0109b1e8449a7c19284f4a430c40f6f1899ab075 100644 (file)
@@ -495,6 +495,7 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
        priv->extclk = devm_clk_get(&pdev->dev, "extclk");
        if (!IS_ERR(priv->extclk)) {
                if (priv->extclk == priv->clk) {
+                       devm_clk_put(&pdev->dev, priv->extclk);
                        priv->extclk = ERR_PTR(-EINVAL);
                } else {
                        dev_info(&pdev->dev, "found external clock\n");