On Sun, 23 Jun 2024 07:50:32 +0200, Christophe JAILLET wrote: > If iio_read_channel_processed() fails, 'val->intval' is not updated, but it > is still *1000 just after. So, in case of error, the *1000 accumulate and > 'val->intval' becomes erroneous. > > So instead of rescaling the value after the fact, use the dedicated scaling > API. This way the result is updated only when needed. In case of error, the > previous value is kept, unmodified. > > [...] Applied, thanks! [1/1] power: supply: ingenic: Fix some error handling paths in ingenic_battery_get_property() commit: f8b6c1eb76f73ed721facd58d0cfb08513aad34c Best regards, -- Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>