summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-tegra.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-07-01 13:00:51 +0800
committerThierry Reding <thierry.reding@avionic-design.de>2012-07-23 13:24:02 +0200
commit0c8f527d8c80a027b46798127a6dd815b4bb99c2 (patch)
tree751e7f9bdb2ddbb124f23f134e93eb7b5c0a8a8e /drivers/pwm/pwm-tegra.c
parent457fd768ee1f7c78e85dfbe86329e6b24eb36514 (diff)
downloadblackbird-op-linux-0c8f527d8c80a027b46798127a6dd815b4bb99c2.tar.gz
blackbird-op-linux-0c8f527d8c80a027b46798127a6dd815b4bb99c2.zip
pwm: Convert pwm-tegra to use devm_clk_get()
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>
Diffstat (limited to 'drivers/pwm/pwm-tegra.c')
-rw-r--r--drivers/pwm/pwm-tegra.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 472b74e8221a..02ce18d5e49a 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -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);
@@ -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;
}
@@ -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
OpenPOWER on IntegriCloud