summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2017-07-22 23:22:59 +0300
committerWim Van Sebroeck <wim@iguana.be>2017-09-09 21:52:13 +0300
commitdd0a18ca4cbdce00bc2b2e0510793205af27c7c5 (patch)
tree03e6fd7fd2894b2705f55f80a75c8eeae7326526
parent15210ad18fcbd7f53f40e26e4391710d271c2daf (diff)
downloadlinux-dd0a18ca4cbdce00bc2b2e0510793205af27c7c5.tar.xz
watchdog: bcm7038: Check the return value from clk_prepare_enable()
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@nxp.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>
-rw-r--r--drivers/watchdog/bcm7038_wdt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c
index c1b8e534fb55..f88f546e8050 100644
--- a/drivers/watchdog/bcm7038_wdt.c
+++ b/drivers/watchdog/bcm7038_wdt.c
@@ -136,7 +136,9 @@ static int bcm7038_wdt_probe(struct platform_device *pdev)
wdt->clk = devm_clk_get(dev, NULL);
/* If unable to get clock, use default frequency */
if (!IS_ERR(wdt->clk)) {
- clk_prepare_enable(wdt->clk);
+ err = clk_prepare_enable(wdt->clk);
+ if (err)
+ return err;
wdt->rate = clk_get_rate(wdt->clk);
/* Prevent divide-by-zero exception */
if (!wdt->rate)