Skip to content

Commit

Permalink
rtc: s3c: Handle clock prepare failures in probe
Browse files Browse the repository at this point in the history
clk_prepare_enable() can fail so handle such case.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
  • Loading branch information
Krzysztof Kozlowski authored and Alexandre Belloni committed Jun 24, 2017
1 parent 6b72086 commit 9903f68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,9 @@ static int s3c_rtc_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "probe deferred due to missing rtc clk\n");
return ret;
}
clk_prepare_enable(info->rtc_clk);
ret = clk_prepare_enable(info->rtc_clk);
if (ret)
return ret;

if (info->data->needs_src_clk) {
info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
Expand All @@ -512,7 +514,9 @@ static int s3c_rtc_probe(struct platform_device *pdev)
"probe deferred due to missing rtc src clk\n");
goto err_src_clk;
}
clk_prepare_enable(info->rtc_src_clk);
ret = clk_prepare_enable(info->rtc_src_clk);
if (ret)
goto err_src_clk;
}

/* check to see if everything is setup correctly */
Expand Down

0 comments on commit 9903f68

Please sign in to comment.