diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-07-01 01:00:51 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2012-07-23 07:24:02 -0400 |
commit | 0c8f527d8c80a027b46798127a6dd815b4bb99c2 (patch) | |
tree | 751e7f9bdb2ddbb124f23f134e93eb7b5c0a8a8e /drivers/pwm | |
parent | 457fd768ee1f7c78e85dfbe86329e6b24eb36514 (diff) |
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')
-rw-r--r-- | drivers/pwm/pwm-tegra.c | 8 |
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) | |||
194 | 194 | ||
195 | platform_set_drvdata(pdev, pwm); | 195 | platform_set_drvdata(pdev, pwm); |
196 | 196 | ||
197 | pwm->clk = clk_get(&pdev->dev, NULL); | 197 | pwm->clk = devm_clk_get(&pdev->dev, NULL); |
198 | if (IS_ERR(pwm->clk)) | 198 | if (IS_ERR(pwm->clk)) |
199 | return PTR_ERR(pwm->clk); | 199 | return PTR_ERR(pwm->clk); |
200 | 200 | ||
@@ -206,7 +206,6 @@ static int tegra_pwm_probe(struct platform_device *pdev) | |||
206 | ret = pwmchip_add(&pwm->chip); | 206 | ret = pwmchip_add(&pwm->chip); |
207 | if (ret < 0) { | 207 | if (ret < 0) { |
208 | dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); | 208 | dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); |
209 | clk_put(pwm->clk); | ||
210 | return ret; | 209 | return ret; |
211 | } | 210 | } |
212 | 211 | ||
@@ -233,10 +232,7 @@ static int __devexit tegra_pwm_remove(struct platform_device *pdev) | |||
233 | clk_disable_unprepare(pc->clk); | 232 | clk_disable_unprepare(pc->clk); |
234 | } | 233 | } |
235 | 234 | ||
236 | pwmchip_remove(&pc->chip); | 235 | return pwmchip_remove(&pc->chip); |
237 | clk_put(pc->clk); | ||
238 | |||
239 | return 0; | ||
240 | } | 236 | } |
241 | 237 | ||
242 | #ifdef CONFIG_OF | 238 | #ifdef CONFIG_OF |