]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: dac: max5522: simplify probe with devm_regulator_get_enable_read_voltage()
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 16 Feb 2026 13:17:05 +0000 (15:17 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 08:24:24 +0000 (08:24 +0000)
commit65d887ff21057dede1684c176e910991700a8bd0
tree493ad6712c03bd8b2da6ffe2ef42043438b075a4
parent93f60f67215e09d281fb0b22d29cb33ff033db61
iio: dac: max5522: simplify probe with devm_regulator_get_enable_read_voltage()

Simplify probe by using devm_regulator_get_enable_read_voltage() to
get, enable and read the regulator voltage in a single call, caching
the value at probe time.

The reference voltage for this DAC is a fixed hardware configuration
that is not expected to change at runtime, so reading it once during
probe and caching the millivolt value is sufficient.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/max5522.c