ASoC: kirkwood-i2s: Use devm_clk_get() for extclk
authorMark Brown <broonie@linaro.org>
Mon, 15 Jul 2013 15:41:14 +0000 (16:41 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 15 Jul 2013 15:43:15 +0000 (16:43 +0100)
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/kirkwood/kirkwood-i2s.c

index 4c9dad3263c5f7b754d108b3bf66a3ebdb6d67f3..44412eaf6e81bb39af689bdc0c32d59d07b273de 100644 (file)
@@ -498,10 +498,9 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
        if (err < 0)
                return err;
 
-       priv->extclk = clk_get(&pdev->dev, "extclk");
+       priv->extclk = devm_clk_get(&pdev->dev, "extclk");
        if (!IS_ERR(priv->extclk)) {
                if (priv->extclk == priv->clk) {
-                       clk_put(priv->extclk);
                        priv->extclk = ERR_PTR(-EINVAL);
                } else {
                        dev_info(&pdev->dev, "found external clock\n");
@@ -529,10 +528,8 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
                return 0;
        dev_err(&pdev->dev, "snd_soc_register_component failed\n");
 
-       if (!IS_ERR(priv->extclk)) {
+       if (!IS_ERR(priv->extclk))
                clk_disable_unprepare(priv->extclk);
-               clk_put(priv->extclk);
-       }
        clk_disable_unprepare(priv->clk);
 
        return err;
@@ -544,10 +541,8 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev)
 
        snd_soc_unregister_component(&pdev->dev);
 
-       if (!IS_ERR(priv->extclk)) {
+       if (!IS_ERR(priv->extclk))
                clk_disable_unprepare(priv->extclk);
-               clk_put(priv->extclk);
-       }
        clk_disable_unprepare(priv->clk);
 
        return 0;