Commit 0c8f527d authored by Axel Lin's avatar Axel Lin Committed by Thierry Reding

pwm: Convert pwm-tegra to use devm_clk_get()

Also return proper error in tegra_pwm_remove() if pwmchip_remove()
fails.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
parent 457fd768
...@@ -194,7 +194,7 @@ static int tegra_pwm_probe(struct platform_device *pdev) ...@@ -194,7 +194,7 @@ static int tegra_pwm_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pwm); 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)) if (IS_ERR(pwm->clk))
return PTR_ERR(pwm->clk); return PTR_ERR(pwm->clk);
...@@ -206,7 +206,6 @@ static int tegra_pwm_probe(struct platform_device *pdev) ...@@ -206,7 +206,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
ret = pwmchip_add(&pwm->chip); ret = pwmchip_add(&pwm->chip);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
clk_put(pwm->clk);
return ret; return ret;
} }
...@@ -233,10 +232,7 @@ static int __devexit tegra_pwm_remove(struct platform_device *pdev) ...@@ -233,10 +232,7 @@ static int __devexit tegra_pwm_remove(struct platform_device *pdev)
clk_disable_unprepare(pc->clk); clk_disable_unprepare(pc->clk);
} }
pwmchip_remove(&pc->chip); return pwmchip_remove(&pc->chip);
clk_put(pc->clk);
return 0;
} }
#ifdef CONFIG_OF #ifdef CONFIG_OF
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment