Linux Watchdog driver development
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-renesas-soc@vger.kernel.org
Cc: "Herve Codina (Schneider Electric)" <herve.codina@bootlin.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	linux-watchdog@vger.kernel.org
Subject: [PATCH v4 2/4] watchdog: rzn1: Use dev_err_probe()
Date: Thu,  7 May 2026 12:24:07 +0200	[thread overview]
Message-ID: <20260507102410.43384-3-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20260507102410.43384-1-wsa+renesas@sang-engineering.com>

From: "Herve Codina (Schneider Electric)" <herve.codina@bootlin.com>

In the probe() function the following pattern is present several times:
	if (err) {
		dev_err(dev, ...);
		return err;
	}

Replace them by dev_err_probe() calls.

Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/watchdog/rzn1_wdt.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
index b7034eac91d0..48d5afef62a5 100644
--- a/drivers/watchdog/rzn1_wdt.c
+++ b/drivers/watchdog/rzn1_wdt.c
@@ -122,22 +122,16 @@ static int rzn1_wdt_probe(struct platform_device *pdev)
 
 	ret = devm_request_irq(dev, irq, rzn1_wdt_irq, 0,
 			       np->name, wdt);
-	if (ret) {
-		dev_err(dev, "failed to request irq %d\n", irq);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to request irq %d\n", irq);
 
 	clk = devm_clk_get_enabled(dev, NULL);
-	if (IS_ERR(clk)) {
-		dev_err(dev, "failed to get the clock\n");
-		return PTR_ERR(clk);
-	}
+	if (IS_ERR(clk))
+		return dev_err_probe(dev, PTR_ERR(clk), "failed to get the clock\n");
 
 	clk_rate = clk_get_rate(clk);
-	if (!clk_rate) {
-		dev_err(dev, "failed to get the clock rate\n");
-		return -EINVAL;
-	}
+	if (!clk_rate)
+		return dev_err_probe(dev, -EINVAL, "failed to get the clock rate\n");
 
 	wdt->clk_rate_khz = clk_rate / 1000;
 	wdt->wdtdev.info = &rzn1_wdt_info;
-- 
2.47.3


  parent reply	other threads:[~2026-05-07 10:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 10:24 [PATCH v4 0/4] watchdog: rzn1: clean up and drop irq requirement Wolfram Sang
2026-05-07 10:24 ` [PATCH v4 1/4] watchdog: rzn1: Fix reverse xmas tree declaration Wolfram Sang
2026-05-08 16:29   ` Guenter Roeck
2026-05-07 10:24 ` Wolfram Sang [this message]
2026-05-08 16:30   ` [PATCH v4 2/4] watchdog: rzn1: Use dev_err_probe() Guenter Roeck
2026-05-07 10:24 ` [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support Wolfram Sang
2026-05-07 11:20   ` Herve Codina
2026-05-07 21:05   ` sashiko-bot
2026-05-08 16:31   ` Guenter Roeck
2026-05-08 20:05     ` Wolfram Sang
2026-05-07 10:24 ` [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required Wolfram Sang
2026-05-07 11:22   ` Herve Codina
2026-05-08 16:32   ` Guenter Roeck
2026-05-13 22:28   ` Rob Herring (Arm)
2026-05-13 22:39   ` Guenter Roeck

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=20260507102410.43384-3-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=herve.codina@bootlin.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wim@linux-watchdog.org \
    /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