Re: [PATCH v3 5/7] iio: light: opt3001: prefer dev_err_probe()

From: Maxwell Doose

Date: Fri May 22 2026 - 01:24:12 EST


On Fri, May 22, 2026 at 12:07 AM Joshua Crofts <joshua.crofts1@xxxxxxxxx> wrote:
>
> On Fri, 22 May 2026 at 03:49, Maxwell Doose <m32285159@xxxxxxxxx> wrote:
> > Ah, but all of the above don't seem like _probe() functions. I'm not
> > an expert on dev_err_probe() but I'm pretty sure it's only for use (or
> > at least, designed for use) in _probe() functions. Only function where
> > I know it's 100% fine in is the one below.
>
> Hi Max,
>
> Actually if you have any functions that are *only* called in _probe(), then
> it is okay to move them to dev_err_probe(), you just have to ensure
> you're not calling dev_err_probe() twice - once in the function and
> once at the call site.
>

Ahh, interesting, I never knew that. Thanks for letting me know,
that's cool. I guess it's more flexible than I thought.

best regards,
max


> --
> Kind regards
>
> CJD