Commit bdf49574 authored by Jingoo Han's avatar Jingoo Han Committed by Wim Van Sebroeck

watchdog: imx2_wdt: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 0b930261
...@@ -261,7 +261,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) ...@@ -261,7 +261,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
if (IS_ERR(imx2_wdt.base)) if (IS_ERR(imx2_wdt.base))
return PTR_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)) { if (IS_ERR(imx2_wdt.clk)) {
dev_err(&pdev->dev, "can't get Watchdog clock\n"); dev_err(&pdev->dev, "can't get Watchdog clock\n");
return PTR_ERR(imx2_wdt.clk); return PTR_ERR(imx2_wdt.clk);
...@@ -286,7 +286,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) ...@@ -286,7 +286,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
fail: fail:
imx2_wdt_miscdev.parent = NULL; imx2_wdt_miscdev.parent = NULL;
clk_put(imx2_wdt.clk);
return ret; return ret;
} }
...@@ -299,8 +298,7 @@ static int __exit imx2_wdt_remove(struct platform_device *pdev) ...@@ -299,8 +298,7 @@ static int __exit imx2_wdt_remove(struct platform_device *pdev)
dev_crit(imx2_wdt_miscdev.parent, dev_crit(imx2_wdt_miscdev.parent,
"Device removed: Expect reboot!\n"); "Device removed: Expect reboot!\n");
} else }
clk_put(imx2_wdt.clk);
imx2_wdt_miscdev.parent = NULL; imx2_wdt_miscdev.parent = NULL;
return 0; return 0;
......
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