diff options
author | Matteo Martelli <matteomartelli3@gmail.com> | 2024-07-30 11:11:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-09-12 12:03:55 +0300 |
commit | c8294c80b71bb4d58e75c5b623b09aa2d36ee3e1 (patch) | |
tree | e0297de0d16a002c9b43c7bdea1b17c9e742e05c /lib | |
parent | 108e0ab0bc4db3250082fa634eda1ee3ac68a63a (diff) | |
download | linux-c8294c80b71bb4d58e75c5b623b09aa2d36ee3e1.tar.xz |
iio: fix scale application in iio_convert_raw_to_processed_unlocked
commit 8a3dcc970dc57b358c8db2702447bf0af4e0d83a upstream.
When the scale_type is IIO_VAL_INT_PLUS_MICRO or IIO_VAL_INT_PLUS_NANO
the scale passed as argument is only applied to the fractional part of
the value. Fix it by also multiplying the integer part by the scale
provided.
Fixes: 48e44ce0f881 ("iio:inkern: Add function to read the processed value")
Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240730-iio-fix-scale-v1-1-6246638c8daa@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions