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

From: Jonathan Cameron

Date: Fri May 22 2026 - 11:05:30 EST


On Fri, 22 May 2026 00:19:16 -0500
Maxwell Doose <m32285159@xxxxxxxxx> wrote:

> 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
opt3001_configure() has a name that makes me think it might well be called
elsewhere (it's not though!). It is probably not worth the churn of
renaming it however.

Jonathan

>
>
> > --
> > Kind regards
> >
> > CJD