Thread (3 messages) 3 messages, 3 authors, 2024-08-28

Re: [PATCH v1] rtc: rtc-asm9260: Switch to use dev_err_probe()

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2024-08-28 12:37:35
Also in: linux-rtc, lkml

On 28/08/2024 14:25, Yang Ruibin wrote:
quoted hunk ↗ jump to hunk
use dev_err_probe() instead of dev_err() to simplify the error path and
standardize the format of the error code.

Signed-off-by: Yang Ruibin <redacted>
---
 drivers/rtc/rtc-asm9260.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
index a83b47e0d..2b7058ebb 100644
--- a/drivers/rtc/rtc-asm9260.c
+++ b/drivers/rtc/rtc-asm9260.c
@@ -268,10 +268,8 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->clk);
 
 	ret = clk_prepare_enable(priv->clk);
-	if (ret) {
-		dev_err(dev, "Failed to enable clk!\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to prepare clk!\n");
 
There is little simplification here, plus this cannot really defer. I
think it would be fine as part of other cleanups but as standalone
single patch I see no benefits of this.

Best regards,
Krzysztof

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help