Re: [PATCH v3 5/6] iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage()
From: Dmitry Torokhov
Date: Mon Mar 09 2026 - 01:36:14 EST
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:
>
> ...
>
> > I think this broke the ACPI case (where regulator isn't available).
>
> Right, and I even have an HW to test (if required).
>
> ...
>
> > > + 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.
Thanks.
--
Dmitry