Skip to contentSkip to conversation

rtc: s3c: Switch to use dev_err_probe() helper

PATCH Applied Yang Yingliang 2 participants 2 messages Sep 19, 2022 – Nov 14, 2022 Real time clock (RTC)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: s3c: Switch to use dev_err_probe() helper

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name.

---
 drivers/rtc/rtc-s3c.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/rtc/rtc-s3c.c +3 -8
index db529733c9c4..8fc5efde3e0b 100644
@@ -429,14 +429,9 @@ static int s3c_rtc_probe(struct platform_device *pdev)
 		return PTR_ERR(info->base);
 
 	info->rtc_clk = devm_clk_get(&pdev->dev, "rtc");
-	if (IS_ERR(info->rtc_clk)) {
-		ret = PTR_ERR(info->rtc_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "failed to find rtc clock\n");
-		else
-			dev_dbg(&pdev->dev, "probe deferred due to missing rtc clk\n");
-		return ret;
-	}
+	if (IS_ERR(info->rtc_clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(info->rtc_clk),
+				     "failed to find rtc clock\n");
 	ret = clk_prepare_enable(info->rtc_clk);
 	if (ret)
 		return ret;
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name.

Applied, thanks!

[1/1] rtc: s3c: Switch to use dev_err_probe() helper

      commit: 25c9da5a536efb9eac59aaa6c1466935841cf694

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com