summaryrefslogtreecommitdiff
path: root/drivers/watchdog/imx2_wdt.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 13:15:53 +0400
committerWim Van Sebroeck <wim@iguana.be>2013-07-11 23:01:06 +0400
commitbdf495742716211259dba644e0950129db6f2641 (patch)
tree10ded0be21922717fe64915695a5a7564c8261e7 /drivers/watchdog/imx2_wdt.c
parent0b9302619963e46931c64693fd24d467c39bbb4c (diff)
downloadlinux-bdf495742716211259dba644e0950129db6f2641.tar.xz
watchdog: imx2_wdt: use devm_clk_get()
Use devm_clk_get() to make cleanup paths more simple. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/imx2_wdt.c')
-rw-r--r--drivers/watchdog/imx2_wdt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
index 62946c2cb4f8..693ac3f4de5a 100644
--- a/drivers/watchdog/imx2_wdt.c
+++ b/drivers/watchdog/imx2_wdt.c
@@ -261,7 +261,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
if (IS_ERR(imx2_wdt.base))
return PTR_ERR(imx2_wdt.base);
- imx2_wdt.clk = clk_get(&pdev->dev, NULL);
+ imx2_wdt.clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(imx2_wdt.clk)) {
dev_err(&pdev->dev, "can't get Watchdog clock\n");
return PTR_ERR(imx2_wdt.clk);
@@ -286,7 +286,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
fail:
imx2_wdt_miscdev.parent = NULL;
- clk_put(imx2_wdt.clk);
return ret;
}
@@ -299,8 +298,7 @@ static int __exit imx2_wdt_remove(struct platform_device *pdev)
dev_crit(imx2_wdt_miscdev.parent,
"Device removed: Expect reboot!\n");
- } else
- clk_put(imx2_wdt.clk);
+ }
imx2_wdt_miscdev.parent = NULL;
return 0;