ASoC: kirkwood: Free external clock if it is a duplicate of internal

[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>
This commit is contained in:
Russell King 2013-08-04 20:23:03 +01:00 committed by Mark Brown
parent a7d0942979
commit af64d7341a

View 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");