Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Fabio Estevam and committed by
Wim Van Sebroeck
db11cba2 aefb163c

+5 -1
+5 -1
drivers/watchdog/imx2_wdt.c
··· 291 291 ret = watchdog_register_device(wdog); 292 292 if (ret) { 293 293 dev_err(&pdev->dev, "cannot register watchdog device\n"); 294 - return ret; 294 + goto disable_clk; 295 295 } 296 296 297 297 wdev->restart_handler.notifier_call = imx2_restart_handler; ··· 304 304 wdog->timeout, nowayout); 305 305 306 306 return 0; 307 + 308 + disable_clk: 309 + clk_disable_unprepare(wdev->clk); 310 + return ret; 307 311 } 308 312 309 313 static int __exit imx2_wdt_remove(struct platform_device *pdev)