提交 db11cba2 编写于 作者: F Fabio Estevam 提交者: Wim Van Sebroeck

watchdog: imx2_wdt: Disable previously acquired clock on error path

If watchdog_register_device() fails we should disable the previously
acquired wdev->clk clock on error path.
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 aefb163c
......@@ -291,7 +291,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
ret = watchdog_register_device(wdog);
if (ret) {
dev_err(&pdev->dev, "cannot register watchdog device\n");
return ret;
goto disable_clk;
}
wdev->restart_handler.notifier_call = imx2_restart_handler;
......@@ -304,6 +304,10 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
wdog->timeout, nowayout);
return 0;
disable_clk:
clk_disable_unprepare(wdev->clk);
return ret;
}
static int __exit imx2_wdt_remove(struct platform_device *pdev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册