Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1668024
| From | Krzysztof Kozlowski <krzk@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 5/6] rtc: s3c: Handle clock prepare failures in probe |
| Date | 2017-06-16 21:30 +0200 |
| Message-ID | <tT56q-4r7-23@gated-at.bofh.it> (permalink) |
| References | <tT56q-4r7-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
clk_prepare_enable() can fail so handle such case.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/rtc/rtc-s3c.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
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 */
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 1/6] rtc: s3c: Jump to central exit point on getting src clock error Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 6/6] rtc: s3c: Handle clock enable failures Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 3/6] rtc: s3c: Drop unneeded cast to void pointer Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 4/6] rtc: s3c: Do not remove const from rodata memory Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 2/6] rtc: s3c: Minor white-space cleanups Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200 [PATCH 5/6] rtc: s3c: Handle clock prepare failures in probe Krzysztof Kozlowski <krzk@kernel.org> - 2017-06-16 21:30 +0200
csiph-web