From: Fabio Estevam Date: Thu, 23 Jan 2014 23:55:05 +0000 (-0800) Subject: drivers/rtc/rtc-mxc.c: check the return value from clk_prepare_enable() X-Git-Tag: MMI-PSA29.97-13-9~12891^2~68 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b3d2243d049e062d0dc53b85f0e95db67e114af;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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)