Re: [PATCH v2 4/4] iio: adc: ti-ads7950: complete conversion to using managed resources

From: Andy Shevchenko

Date: Sun Feb 22 2026 - 14:12:37 EST


On Fri, Feb 20, 2026 at 04:09:47PM -0800, Dmitry Torokhov wrote:
> On Thu, Feb 19, 2026 at 09:59:35AM +0200, Andy Shevchenko wrote:
> > On Wed, Feb 18, 2026 at 06:29:28PM -0800, Dmitry Torokhov wrote:

...

> > > + if (error) {
> > > dev_err(&spi->dev, "Error in spi setup\n");
> > > - return ret;
> > > + return error;
> > > }
> >
> > And since there is already dev_err_probe() in use, I would expect this
> > also be converted.
>
> But that would be unrelated change ;)

I never told that this should be done here.

...

> > Would be also nice to use
> >
> > struct device *dev = &spi->dev;
> >
> > to make less LoCs and/or make them shorter.
>
> I actually dislike introducing such temporaries in majority of the
> cases. It makes it hard to follow what device we are dealing with and
> does not make the code significantly shorter.

May be, but my experience is telling me different story.
So we have a disagreement here, I leave it to Jonathan
to mediate.

--
With Best Regards,
Andy Shevchenko