iio: addac: ad74413r: use devm_regulator_get_enable_read_voltage()
authorNuno Sa <nuno.sa@analog.com>
Wed, 16 Oct 2024 14:22:00 +0000 (16:22 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 21 Oct 2024 18:19:25 +0000 (19:19 +0100)
commitab9795c197acc21a1a9156599c8b6ace31baec0e
tree97bdc638af9fe5b68a45bb5c6ac137b29b10b4a6
parente902145064ecdfa10935131fd427c4d455cf908f
iio: addac: ad74413r: use devm_regulator_get_enable_read_voltage()

It's highly unlikely for the converter ref voltage to change at runtime.
Hence, let's read the voltage and save it (instead of the regulator
struct). While at it, simplify the code by using
devm_regulator_get_enable_read_voltage().

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241016-dev-ad74413r-minor-improv-v1-2-13c9c769237d@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/addac/ad74413r.c