]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: dac: mcp47feb02: Fix Vref validation [1-999] case
authorAriana Lazar <ariana.lazar@microchip.com>
Tue, 10 Mar 2026 11:56:44 +0000 (13:56 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 15 Mar 2026 12:27:41 +0000 (12:27 +0000)
commitdd154646d292cce7de952f216760c58c35cfecde
tree2e0367feaf21c10e40bfd99cf763130970ee001b
parentc05a87d9ec3bf8727a5d746ce855003c6f2f8bb4
iio: dac: mcp47feb02: Fix Vref validation [1-999] case

Store reference voltages in uV instead of mV to avoid invalid error code
in dev_err_probe() call. Vref variables store the actual value returned by
devm_regulator_get_enable_read_voltage() function instead of the results of
dividing it by MILLI. The corner case [1-999] divided by MILLI of the
voltage reference variable value would become 0 is covered too.

Fixes: bf394cc80369 ("iio: dac: adding support for Microchip MCP47FEB02")
Link: https://lore.kernel.org/all/aYXvP5FLA5BvkoVX@stanley.mountain/
Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/mcp47feb02.c