mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Balakrishnan Sambath <balakrishnan.s@microchip.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	"Orson Zhai" <orsonzhai@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-rtc@vger.kernel.org>,
	"Balakrishnan Sambath" <balakrishnan.s@microchip.com>
Subject: [PATCH 1/4] rtc: palmas: convert to dev_err_probe()
Date: Thu, 28 May 2026 09:16:44 +0530	[thread overview]
Message-ID: <20260528-cleanup-dev-err-probe-rtc-v1-1-29dc9cb6c3f0@microchip.com> (raw)
In-Reply-To: <20260528-cleanup-dev-err-probe-rtc-v1-0-29dc9cb6c3f0@microchip.com>

Use dev_err_probe() in place of dev_err() and return, which
communicates the error type and helps debugging hardware issues.

No functional change.

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
---
 drivers/rtc/rtc-palmas.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/rtc/rtc-palmas.c b/drivers/rtc/rtc-palmas.c
index aecada6bcf8..25fe7a8b73a 100644
--- a/drivers/rtc/rtc-palmas.c
+++ b/drivers/rtc/rtc-palmas.c
@@ -242,10 +242,8 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 
 	/* Clear pending interrupts */
 	ret = palmas_clear_interrupts(&pdev->dev);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "clear RTC int failed, err = %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "clear RTC int failed\n");
 
 	palmas_rtc->dev = &pdev->dev;
 	platform_set_drvdata(pdev, palmas_rtc);
@@ -280,10 +278,8 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 	ret = palmas_update_bits(palmas, PALMAS_RTC_BASE, PALMAS_RTC_CTRL_REG,
 			PALMAS_RTC_CTRL_REG_STOP_RTC,
 			PALMAS_RTC_CTRL_REG_STOP_RTC);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "RTC_CTRL write failed, err = %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "RTC_CTRL write failed\n");
 
 	palmas_rtc->irq = platform_get_irq(pdev, 0);
 
@@ -292,18 +288,15 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 				&palmas_rtc_ops, THIS_MODULE);
 	if (IS_ERR(palmas_rtc->rtc)) {
 		ret = PTR_ERR(palmas_rtc->rtc);
-		dev_err(&pdev->dev, "RTC register failed, err = %d\n", ret);
-		return ret;
+		return dev_err_probe(&pdev->dev, ret, "RTC register failed\n");
 	}
 
 	ret = devm_request_threaded_irq(&pdev->dev, palmas_rtc->irq, NULL,
 			palmas_rtc_interrupt,
 			IRQF_TRIGGER_LOW | IRQF_ONESHOT,
 			dev_name(&pdev->dev), palmas_rtc);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "IRQ request failed, err = %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret, "IRQ request failed\n");
 
 	return 0;
 }

-- 
2.34.1


  reply	other threads:[~2026-05-28  3:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  3:46 [PATCH 0/4] rtc: convert several drivers " Balakrishnan Sambath
2026-05-28  3:46 ` Balakrishnan Sambath [this message]
2026-06-30 17:10   ` [PATCH 1/4] rtc: palmas: convert " Alexandre Mergnat
2026-05-28  3:46 ` [PATCH 2/4] rtc: moxart: " Balakrishnan Sambath
2026-06-30 17:10   ` Alexandre Mergnat
2026-05-28  3:46 ` [PATCH 3/4] rtc: sc27xx: " Balakrishnan Sambath
2026-06-30 17:10   ` Alexandre Mergnat
2026-05-28  3:46 ` [PATCH 4/4] rtc: s35390a: " Balakrishnan Sambath
2026-06-30 17:10   ` Alexandre Mergnat
2026-07-01  7:26     ` Balakrishnan.S
2026-07-01  8:57       ` Alexandre Belloni
2026-07-02  4:01         ` Balakrishnan.S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260528-cleanup-dev-err-probe-rtc-v1-1-29dc9cb6c3f0@microchip.com \
    --to=balakrishnan.s@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome