From: Krzysztof Kozlowski Date: Fri, 16 Jun 2017 19:28:06 +0000 (+0200) Subject: rtc: s3c: Handle clock prepare failures in probe X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9903f68af6ca9d9b25f5c50bfedd2e0cb899f848;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git rtc: s3c: Handle clock prepare failures in probe clk_prepare_enable() can fail so handle such case. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index c666b95fb8d7..0cb2f27a30b4 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -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"); @@ -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 */