Re: [PATCH v3 5/6] iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage()
From: Andy Shevchenko
Date: Mon Mar 09 2026 - 04:52:48 EST
On Mon, Mar 09, 2026 at 05:35:58AM +0000, Dmitry Torokhov wrote:
> On Sun, Mar 08, 2026 at 10:32:13PM +0200, Andy Shevchenko wrote:
> > On Sat, Mar 07, 2026 at 11:49:47AM +0000, Jonathan Cameron wrote:
> > > On Thu, 05 Mar 2026 11:21:56 -0800
> > > Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:
...
> > > > + ret = devm_regulator_get_enable_read_voltage(&spi->dev, "vref");
> > > > + if (ret < 0)
> > >
> > > I think you need to check for -ENODEV and if you see than then
> > > see if the acpi route below applies. Otherwise on ACPI this will fail
> > > and we'll fail the probe.
> >
> > Yep, just make it default without even checking the fwnode type.
> > No need to bring the whole acpi.h into the mix.
>
> I do not think this would be correct behavior. On non-ACPI systems the
> regulator is mandatory, and the driver should not blindly apply scale
> from ACPI systems just because regulator is missing in the DTS.
I mistakenly thought that original code doesn't have that cneck. Yes, the
ACPI_COMPANION() should be preserved.
--
With Best Regards,
Andy Shevchenko