Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db11cba2 authored by Fabio Estevam's avatar Fabio Estevam Committed by Wim Van Sebroeck
Browse files

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: default avatarFabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent aefb163c
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -291,7 +291,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
	ret = watchdog_register_device(wdog);
	ret = watchdog_register_device(wdog);
	if (ret) {
	if (ret) {
		dev_err(&pdev->dev, "cannot register watchdog device\n");
		dev_err(&pdev->dev, "cannot register watchdog device\n");
		return ret;
		goto disable_clk;
	}
	}


	wdev->restart_handler.notifier_call = imx2_restart_handler;
	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);
		 wdog->timeout, nowayout);


	return 0;
	return 0;

disable_clk:
	clk_disable_unprepare(wdev->clk);
	return ret;
}
}


static int __exit imx2_wdt_remove(struct platform_device *pdev)
static int __exit imx2_wdt_remove(struct platform_device *pdev)