summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/davinci_wdt.c
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-06-06 12:17:53 +0200
committerWim Van Sebroeck <wim@iguana.be>2017-07-03 11:02:38 +0200
commit8f11eb58ad5747bab622910cc2efaa45e6a21c1f (patch)
tree6f685b912fabac260b4b4b70a322f821a8618d19 /drivers/watchdog/davinci_wdt.c
parentwatchdog: meson: Handle return value of clk_prepare_enable (diff)
downloadlinux-8f11eb58ad5747bab622910cc2efaa45e6a21c1f.tar.xz
linux-8f11eb58ad5747bab622910cc2efaa45e6a21c1f.zip
watchdog: davinci: Handle return value of clk_prepare_enable
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/davinci_wdt.c')
-rw-r--r--drivers/watchdog/davinci_wdt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
index 0e731d797a2a..1ba9ead7d75a 100644
--- a/drivers/watchdog/davinci_wdt.c
+++ b/drivers/watchdog/davinci_wdt.c
@@ -173,7 +173,11 @@ static int davinci_wdt_probe(struct platform_device *pdev)
return PTR_ERR(davinci_wdt->clk);
}
- clk_prepare_enable(davinci_wdt->clk);
+ ret = clk_prepare_enable(davinci_wdt->clk);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to prepare clock\n");
+ return ret;
+ }
platform_set_drvdata(pdev, davinci_wdt);