Re: [PATCH] iio: dac: mcp47feb02: Fix Vref validation [1-999] case

From: Andy Shevchenko

Date: Fri Mar 06 2026 - 07:09:34 EST


On Thu, Mar 05, 2026 at 12:48:39PM +0200, Ariana Lazar wrote:
> 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

dev_err_probe()

> devm_regulator_get_enable_read_voltage function instead of the results of

devm_regulator_get_enable_read_voltage()


> 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/

>

Shouldn't be a blank line in the tag block.

...

> + int vref1_uV = 0;
> + int vref_uV = 0;

Better to split assignments and make them when they are needed.

--
With Best Regards,
Andy Shevchenko