Skip to content

Commit

Permalink
ASoC: kirkwood-i2s: Use devm_clk_get() for extclk
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
broonie committed Jul 15, 2013
1 parent 30d3924 commit 4734dc9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions sound/soc/kirkwood/kirkwood-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 4734dc9

Please sign in to comment.