Re: [PATCH] Remove error prints for devm_add_action_or_reset()

Andy Shevchenko
2025-07-01T17:57:40Z

On Tue, Jul 1, 2025 at 8:44 PM Uwe Kleine-König <ukleinek@kernel.org> wrote:
> On Tue, Jul 01, 2025 at 05:03:33PM +0200, Waqar Hameed wrote:

...

> With that
>
> ret = devm_add_action_or_reset(dev, meson_pwm_s4_put_clk,
> meson->channels[i].clk);
> if (ret)
> return dev_err_probe(dev, ret,
> "Failed to add clk_put action\n");
>
> from drivers/pwm/pwm-meson.c is optimized to
>
> ret = devm_add_action_or_reset(dev, meson_pwm_s4_put_clk,
> meson->channels[i].clk);
> if (ret)
> return ret;
>
> .
>
> I would prefer this approach, because a) there is no need to drop all
> dev_err_probe()s after devm_add_action_or_reset() and b) the
> dev_err_probe()s could stay for consistency in the error paths of a
> driver.

Why do we need a dev_err_probe() after devm_add_action*()? I would
expect that the original call (if needed) can spit out a message.

--
With Best Regards,
Andy Shevchenko