Re: [PATCH v2 4/4] iio: adc: ti-ads7950: complete conversion to using managed resources
From: Dmitry Torokhov
Date: Sun Feb 22 2026 - 16:39:39 EST
On Sun, Feb 22, 2026 at 02:09:23PM +0000, Jonathan Cameron wrote:
> On Wed, 18 Feb 2026 18:29:28 -0800
> Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:
>
> > All resources that the driver needs have managed API now. Switch to
> > using them to make code clearer and drop ti_ads7950_remove().
> >
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
>
> Hi Dmitry
>
> One additional comment from me.
>
> > static int ti_ads7950_probe(struct spi_device *spi)
> > {
>
> > indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
> > @@ -598,36 +605,36 @@ static int ti_ads7950_probe(struct spi_device *spi)
> > mutex_init(&st->slock);
> >
> > st->reg = devm_regulator_get(&spi->dev, "vref");
> > - if (IS_ERR(st->reg)) {
> > - ret = dev_err_probe(&spi->dev, PTR_ERR(st->reg),
> > + error = PTR_ERR_OR_ZERO(st->reg);
>
> To me this reads worse than original IS_ERR() / PTR_ERR() pair.
OK, I'll keep that in mind. It is no longer there anyways after
converting to devm_regulator_get_enable_read_voltage() that David
suggested.
Thanks.
--
Dmitry