summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2014-01-23 15:55:05 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 16:36:59 -0800
commit1b3d2243d049e062d0dc53b85f0e95db67e114af (patch)
treee0cc27d6250a53477d851ffc67f191458f76f2bc /drivers/rtc
parentfbd5e754cb03c134ed45ff3417606daf61f576ca (diff)
downloadlinux-1b3d2243d049e062d0dc53b85f0e95db67e114af.tar.bz2
drivers/rtc/rtc-mxc.c: check the return value from clk_prepare_enable()
clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-mxc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index a3ed1cf935ba..419874fefa4b 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -394,7 +394,10 @@ static int mxc_rtc_probe(struct platform_device *pdev)
return PTR_ERR(pdata->clk);
}
- clk_prepare_enable(pdata->clk);
+ ret = clk_prepare_enable(pdata->clk);
+ if (ret)
+ return ret;
+
rate = clk_get_rate(pdata->clk);
if (rate == 32768)