Re: [PATCH v13 2/2] Add PWM fan controller driver for LGM SoC

From: Andy Shevchenko
Date: Fri Sep 25 2020 - 04:59:30 EST


On Thu, Sep 24, 2020 at 04:16:59PM +0200, Uwe Kleine-König wrote:
> On Thu, Sep 24, 2020 at 04:23:34PM +0300, Andy Shevchenko wrote:
> > On Thu, Sep 24, 2020 at 08:55:34AM +0200, Uwe Kleine-König wrote:

...

> > True. And above dev_err_probe() is not needed.
>
> You argue that dev_err_probe() gives no benefit as
> lgm_reset_control_deassert won't return -EPROBE_DEFER, right?
>
> Still I consider it a useful function because
>
> a) I (as an author or as a reviewer) don't need to think if the
> failing function might return -EPROBE_DEFER now or in the future.
> dev_err_probe does the right thing even for functions that don't
> return -EPROBE_DEFER.
>
> b) With dev_err_probe() I can accomplish things in a single line that
> need two lines when open coding it.
>
> c) dev_err_probe() emits the symbolic error name without having to
> resort to %pe + ERR_PTR.
>
> d) Using dev_err_probe() for all error paths gives a consistency that I
> like with a maintainer's hat on.
>
> So I still want to request using dev_err_probe() in all error paths.

As a maintainer it is your choice. I really would like to see more consensus
among maintainers, some are insisting of what I said, some, like you, on the
opposite, some hate that API and some simply don't care.

And on top of that I saw already use of API without taking returned value into
account.

--
With Best Regards,
Andy Shevchenko