diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2015-06-22 07:16:19 +0300 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2015-06-26 11:41:18 +0300 |
commit | db11cba205b6710a71ef52a0f24e0ef059f29f1c (patch) | |
tree | c9021ef24e7fabb4a039202c47f99a768e18ca37 /drivers/watchdog | |
parent | aefb163cb2b876bcbbceee47e3e4f22ed7364630 (diff) | |
download | linux-db11cba205b6710a71ef52a0f24e0ef059f29f1c.tar.xz |
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: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/imx2_wdt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index add1fa0fad17..0bb1a1d1b170 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c @@ -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) |