iio: adc: max1027: Fix wrong shift with 12-bit devices
authorMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 18 Aug 2021 11:11:24 +0000 (13:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:45:02 +0000 (11:45 +0200)
commit1671cfd31b66fcc90812de0b9d8c8c1e71917ba4
tree0bad7d954f511828ce5494ceb689cbc9fd281416
parentf931076d32b686014cf31f12cdb2781aa26bff46
iio: adc: max1027: Fix wrong shift with 12-bit devices

commit 732ae19ee8f58ecaf30cbc1bbbda5cbee6a45043 upstream.

10-bit devices must shift the value twice.
This is not needed anymore on 12-bit devices.

Fixes: ae47d009b508 ("iio: adc: max1027: Introduce 12-bit devices support")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210818111139.330636-2-miquel.raynal@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/max1027.c