* [PATCH] rtc: s3c: Simplify with dev_err_probe()
@ 2020-08-30 8:09 Krzysztof Kozlowski
2020-09-15 8:42 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-30 8:09 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni, linux-rtc, linux-kernel
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and the error value gets printed.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/rtc/rtc-s3c.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index e1b50e682fc4..24a41909f049 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -494,13 +494,8 @@ static int s3c_rtc_probe(struct platform_device *pdev)
if (info->data->needs_src_clk) {
info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
if (IS_ERR(info->rtc_src_clk)) {
- ret = PTR_ERR(info->rtc_src_clk);
- if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev,
- "failed to find rtc source clock\n");
- else
- dev_dbg(&pdev->dev,
- "probe deferred due to missing rtc src clk\n");
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(info->rtc_src_clk),
+ "failed to find rtc source clock\n");
goto err_src_clk;
}
ret = clk_prepare_enable(info->rtc_src_clk);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtc: s3c: Simplify with dev_err_probe()
2020-08-30 8:09 [PATCH] rtc: s3c: Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2020-09-15 8:42 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2020-09-15 8:42 UTC (permalink / raw)
To: linux-kernel, Krzysztof Kozlowski, linux-rtc, Alessandro Zummo
Cc: Alexandre Belloni
On Sun, 30 Aug 2020 10:09:37 +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
Applied, thanks!
[1/1] rtc: s3c: Simplify with dev_err_probe()
commit: c52d270c68a02f94c5c081b7fc57119058e4670a
Best regards,
--
Alexandre Belloni <alexandre.belloni@bootlin.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-15 8:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-30 8:09 [PATCH] rtc: s3c: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-15 8:42 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).