summaryrefslogtreecommitdiff
path: root/drivers/iio/health
diff options
context:
space:
mode:
authorWilfried Wessner <wilfried.wessner@gmail.com>2021-02-08 15:27:05 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-02-12 19:04:32 +0000
commitf890987fac8153227258121740a9609668c427f3 (patch)
treecce7b6918e426affef566c74a6d24e9425728660 /drivers/iio/health
parentd68c592e02f6f49a88e705f13dfc1883432cf300 (diff)
iio: adc: ad7949: fix wrong ADC result due to incorrect bit mask
Fixes a wrong bit mask used for the ADC's result, which was caused by an improper usage of the GENMASK() macro. The bits higher than ADC's resolution are undefined and if not masked out correctly, a wrong result can be given. The GENMASK() macro indexing is zero based, so the mask has to go from [resolution - 1 , 0]. Fixes: 7f40e0614317f ("iio:adc:ad7949: Add AD7949 ADC driver family") Signed-off-by: Wilfried Wessner <wilfried.wessner@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Charles-Antoine Couret <charles-antoine.couret@essensium.com> Cc: <Stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210208142705.GA51260@ubuntu Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/health')
0 files changed, 0 insertions, 0 deletions