[PATCH 2/5] watchdog: rzn1: Use dev_err_probe()

Herve Codina (Schneider Electric)
2026-03-10T17:33:15Z

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>
---
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..98978b5cc5b4 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\n");

wdt->clk_rate_khz = clk_rate / 1000;
wdt->wdtdev.info = &rzn1_wdt_info;
--
2.53.0