Re: [PATCH v3 5/6] iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage()

From: Andy Shevchenko

Date: Sun Mar 08 2026 - 16:32:33 EST


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.

--
With Best Regards,
Andy Shevchenko