提交 1b3d2243 编写于 作者: F Fabio Estevam 提交者: Linus Torvalds

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: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fbd5e754
...@@ -394,7 +394,10 @@ static int mxc_rtc_probe(struct platform_device *pdev) ...@@ -394,7 +394,10 @@ static int mxc_rtc_probe(struct platform_device *pdev)
return PTR_ERR(pdata->clk); 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); rate = clk_get_rate(pdata->clk);
if (rate == 32768) if (rate == 32768)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册