mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
f8b6c1eb76
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.
This should also reduce any inaccuracies resulting from the scaling.
Finally, this is also slightly more efficient as it saves a function call
and a multiplication.
Fixes:
|
||
---|---|---|
.. | ||
reset | ||
supply | ||
Kconfig | ||
Makefile |