summaryrefslogtreecommitdiff
path: root/drivers/watchdog/coh901327_wdt.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-06-12 19:19:01 +0200
committerWim Van Sebroeck <wim@iguana.be>2012-07-23 12:46:49 +0200
commitc362cb597b5c30a32f4228136e0dfd9bf4c5d65b (patch)
tree6c9aa0dac7dd924e14c2e7214a220d1c21f49031 /drivers/watchdog/coh901327_wdt.c
parent3017020dc73a3ae222db2cda9b5952f0e4cf7a09 (diff)
downloadlwn-c362cb597b5c30a32f4228136e0dfd9bf4c5d65b.tar.gz
lwn-c362cb597b5c30a32f4228136e0dfd9bf4c5d65b.zip
watchdog: coh901327_wdt: use clk_prepare/unprepare
Make sure we prepare/unprepare the COH901327 watchdog timer as is required by the clk API especially if you use common clock. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by : Pankaj Jangra <jangra.pankaj9@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/coh901327_wdt.c')
-rw-r--r--drivers/watchdog/coh901327_wdt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c
index 6876430a9f5e..cb5da5c3ece2 100644
--- a/drivers/watchdog/coh901327_wdt.c
+++ b/drivers/watchdog/coh901327_wdt.c
@@ -263,6 +263,7 @@ static int __exit coh901327_remove(struct platform_device *pdev)
watchdog_unregister_device(&coh901327_wdt);
coh901327_disable();
free_irq(irq, pdev);
+ clk_unprepare(clk);
clk_put(clk);
iounmap(virtbase);
release_mem_region(phybase, physize);
@@ -300,9 +301,9 @@ static int __init coh901327_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "could not get clock\n");
goto out_no_clk;
}
- ret = clk_enable(clk);
+ ret = clk_prepare_enable(clk);
if (ret) {
- dev_err(&pdev->dev, "could not enable clock\n");
+ dev_err(&pdev->dev, "could not prepare and enable clock\n");
goto out_no_clk_enable;
}
@@ -369,7 +370,7 @@ static int __init coh901327_probe(struct platform_device *pdev)
out_no_wdog:
free_irq(irq, pdev);
out_no_irq:
- clk_disable(clk);
+ clk_disable_unprepare(clk);
out_no_clk_enable:
clk_put(clk);
out_no_clk: