Re: [PATCH v2 2/3] watchdog: rzn1: Use dev_err_probe()
From: Wolfram Sang
Date: Fri Mar 13 2026 - 13:18:58 EST
On Fri, Mar 13, 2026 at 10:24:15AM +0100, Herve Codina (Schneider Electric) wrote:
> 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@xxxxxxxxxxx>
I am a fan of such changes, though :)
> 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");
Wrong error string, we handle "clock rate" here.
With that fixed:
Reviewed-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
Tested-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
Attachment:
signature.asc
Description: PGP signature