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

From: Andy Shevchenko

Date: Thu Feb 19 2026 - 02:59:54 EST


On Wed, Feb 18, 2026 at 06:29:28PM -0800, Dmitry Torokhov wrote:
> All resources that the driver needs have managed API now. Switch to
> using them to make code clearer and drop ti_ads7950_remove().

...

> static int ti_ads7950_probe(struct spi_device *spi)
> {
> struct ti_ads7950_state *st;
> struct iio_dev *indio_dev;
> const struct ti_ads7950_chip_info *info;
> - int ret;
> + int error;

Unrelated change.

...

> spi->bits_per_word = 16;
> spi->mode |= SPI_CS_WORD;
> - ret = spi_setup(spi);
> - if (ret < 0) {
> + error = spi_setup(spi);
> + if (error) {
> dev_err(&spi->dev, "Error in spi setup\n");
> - return ret;
> + return error;
> }

Ditto.

And since there is already dev_err_probe() in use, I would expect this
also be converted.

Would be also nice to use

struct device *dev = &spi->dev;

to make less LoCs and/or make them shorter.

--
With Best Regards,
Andy Shevchenko