Re: [PATCH v2 4/7] iio: addac: ad74115: Use devm_regulator_get_enable_read_voltage()

From: Jonathan Cameron
Date: Sat May 04 2024 - 07:25:25 EST


On Mon, 29 Apr 2024 18:40:12 -0500
David Lechner <dlechner@xxxxxxxxxxxx> wrote:

> We can reduce boilerplate code by using
> devm_regulator_get_enable_read_voltage().
>
> To maintain backwards compatibility in the case a DT does not provide
> an avdd-supply, we fall back to calling devm_regulator_get_enable()
> so that there is no change in user-facing behavior (e.g. dummy regulator
> will still be in sysfs).
>
> Also add an informative error message when we failed to get the voltage
> and knowing the voltage is required while we are touching this.
>
> Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
A somewhat fiddly case. I think you've done it the best way possible though.

Acked-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>