]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drivers: iio: adc: ltc2497: fix LSB shift
authorIan Ray <ian.ray@ge.com>
Fri, 27 Jan 2023 12:57:14 +0000 (14:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Apr 2023 14:55:26 +0000 (16:55 +0200)
commitb3ea2426cc224394516a97faed2087f14721a915
tree8c80f15f358b025dd5bcef14b5700e70abf725ea
parent2fc86605075122e0b0744635e3e9f3c43ab2c44c
drivers: iio: adc: ltc2497: fix LSB shift

commit 6327a930ab7bfa1ab33bcdffd5f5f4b1e7131504 upstream.

Correct the "sub_lsb" shift for the ltc2497 and drop the sub_lsb element
which is now constant.

An earlier version of the code shifted by 14 but this was a consequence
of reading three bytes into a __be32 buffer and using be32_to_cpu(), so
eight extra bits needed to be skipped.  Now we use get_unaligned_be24()
and thus the additional skip is wrong.

Fixes: 2187cfeb3626 ("drivers: iio: adc: ltc2497: LTC2499 support")
Signed-off-by: Ian Ray <ian.ray@ge.com>
Link: https://lore.kernel.org/r/20230127125714.44608-1-ian.ray@ge.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ltc2497.c