Skip to contentSkip to conversation

rtc: s3c: Simplify with dev_err_probe()

PATCH Applied Krzysztof Kozlowski 2 participants 2 messages Aug 30, 2020 – Sep 15, 2020 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: s3c: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed.

---
 drivers/rtc/rtc-s3c.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/rtc/rtc-s3c.c +2 -7
index e1b50e682fc4..24a41909f049 100644
@@ -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);
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Krzysztof Kozlowski

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,

Signature · 1 line
Alexandre Belloni <[email protected]>