提交 eaf3a659 编写于 作者: M Marek Szyprowski 提交者: Linus Torvalds

drivers/rtc/rtc-s3c.c: fix initialization failure without rtc source clock

Fix unconditional initialization failure on non-exynos3250 SoCs.

Commit df9e26d0 ("rtc: s3c: add support for RTC of Exynos3250 SoC")
introduced rtc source clock support, but also added initialization
failure on SoCs, which doesn't need such clock.
Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: NChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 0baf2a4d
...@@ -535,13 +535,15 @@ static int s3c_rtc_probe(struct platform_device *pdev) ...@@ -535,13 +535,15 @@ static int s3c_rtc_probe(struct platform_device *pdev)
} }
clk_prepare_enable(info->rtc_clk); clk_prepare_enable(info->rtc_clk);
info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src"); if (info->data->needs_src_clk) {
if (IS_ERR(info->rtc_src_clk)) { info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
dev_err(&pdev->dev, "failed to find rtc source clock\n"); if (IS_ERR(info->rtc_src_clk)) {
return PTR_ERR(info->rtc_src_clk); dev_err(&pdev->dev,
"failed to find rtc source clock\n");
return PTR_ERR(info->rtc_src_clk);
}
clk_prepare_enable(info->rtc_src_clk);
} }
clk_prepare_enable(info->rtc_src_clk);
/* check to see if everything is setup correctly */ /* check to see if everything is setup correctly */
if (info->data->enable) if (info->data->enable)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册