]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 6 Apr 2026 04:39:25 +0000 (21:39 -0700)
committerJonathan Cameron <jic23@kernel.org>
Mon, 27 Apr 2026 08:58:17 +0000 (09:58 +0100)
commit86f6d0949e1272d97f91f550bf6f0ccd79fbf17e
tree89f763b734c58c06ccd9eac1f943c029c3ee5da4
parent1c3b46b9dec4349f81f432b8ad0829714d3757ba
iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage()

The regulator is enabled for the entire time the driver is bound to the
device, and we only need to access it to fetch voltage, which can be
done at probe time.

Switch to using devm_regulator_get_enable_read_voltage() which
simplifies probing and unbinding code.

Suggested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-ads7950.c