Skip to content

Commit

Permalink
pwm: Convert pwm-tegra to use devm_clk_get()
Browse files Browse the repository at this point in the history
Also return proper error in tegra_pwm_remove() if pwmchip_remove()
fails.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
  • Loading branch information
Axel Lin authored and Thierry Reding committed Jul 23, 2012
1 parent 457fd76 commit 0c8f527
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/pwm/pwm-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static int tegra_pwm_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, pwm);

pwm->clk = clk_get(&pdev->dev, NULL);
pwm->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pwm->clk))
return PTR_ERR(pwm->clk);

Expand All @@ -206,7 +206,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
ret = pwmchip_add(&pwm->chip);
if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
clk_put(pwm->clk);
return ret;
}

Expand All @@ -233,10 +232,7 @@ static int __devexit tegra_pwm_remove(struct platform_device *pdev)
clk_disable_unprepare(pc->clk);
}

pwmchip_remove(&pc->chip);
clk_put(pc->clk);

return 0;
return pwmchip_remove(&pc->chip);
}

#ifdef CONFIG_OF
Expand Down

0 comments on commit 0c8f527

Please sign in to comment.