drivers/rtc/rtc-s3c.c: fix initialization failure without rtc source clock
Fix unconditional initialization failure on non-exynos3250 SoCs.
Commit df9e26d093
("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: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0baf2a4dbf
commit
eaf3a65908
1 changed files with 8 additions and 6 deletions
|
@ -535,13 +535,15 @@ static int s3c_rtc_probe(struct platform_device *pdev)
|
|||
}
|
||||
clk_prepare_enable(info->rtc_clk);
|
||||
|
||||
info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
|
||||
if (IS_ERR(info->rtc_src_clk)) {
|
||||
dev_err(&pdev->dev, "failed to find rtc source clock\n");
|
||||
return PTR_ERR(info->rtc_src_clk);
|
||||
if (info->data->needs_src_clk) {
|
||||
info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
|
||||
if (IS_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 */
|
||||
if (info->data->enable)
|
||||
|
|
Loading…
Reference in a new issue