Skip to content
Unverified Commit 41b94bc6 authored by David Lechner's avatar David Lechner Committed by Mark Brown
Browse files

iio: addac: ad74115: Use devm_regulator_get_enable_read_voltage()



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: default avatarDavid Lechner <dlechner@baylibre.com>
Acked-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240429-regulator-get-enable-get-votlage-v2-4-b1f11ab766c1@baylibre.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 346fe0ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment