Skip to content

Commit

Permalink
drivers/rtc/rtc-s3c.c: fix initialization failure without rtc source …
Browse files Browse the repository at this point in the history
…clock

Fix unconditional initialization failure on non-exynos3250 SoCs.

Commit df9e26d ("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 <[email protected]>
Reviewed-by: Chanwoo Choi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mszyprow authored and torvalds committed Oct 29, 2014
1 parent 0baf2a4 commit eaf3a65
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eaf3a65

Please sign in to comment.