summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-06-22 01:16:18 -0300
committerWim Van Sebroeck <wim@iguana.be>2015-06-26 10:41:11 +0200
commitaefb163cb2b876bcbbceee47e3e4f22ed7364630 (patch)
tree1b86dc1d609e293e2dc72a6db5c2258e8c3dbcdd /drivers/watchdog
parent46c80b20d07e9309677d81e1226dc30a055b63b7 (diff)
downloadlinux-aefb163cb2b876bcbbceee47e3e4f22ed7364630.tar.gz
linux-aefb163cb2b876bcbbceee47e3e4f22ed7364630.tar.bz2
linux-aefb163cb2b876bcbbceee47e3e4f22ed7364630.zip
watchdog: imx2_wdt: Check for clk_prepare_enable() error
clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error. 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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
index 2acdd17025c4..add1fa0fad17 100644
--- a/drivers/watchdog/imx2_wdt.c
+++ b/drivers/watchdog/imx2_wdt.c
@@ -260,7 +260,9 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
wdog->max_timeout = IMX2_WDT_MAX_TIME;
wdog->parent = &pdev->dev;
- clk_prepare_enable(wdev->clk);
+ ret = clk_prepare_enable(wdev->clk);
+ if (ret)
+ return ret;
regmap_read(wdev->regmap, IMX2_WDT_WRSR, &val);
wdog->bootstatus = val & IMX2_WDT_WRSR_TOUT ? WDIOF_CARDRESET : 0;
@@ -365,8 +367,11 @@ static int imx2_wdt_resume(struct device *dev)
{
struct watchdog_device *wdog = dev_get_drvdata(dev);
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
+ int ret;
- clk_prepare_enable(wdev->clk);
+ ret = clk_prepare_enable(wdev->clk);
+ if (ret)
+ return ret;
if (watchdog_active(wdog) && !imx2_wdt_is_running(wdev)) {
/*