Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: pressure: dlhl60d: Don't take garbage into consideration when reading data

Both pressure and temperature are 24-bit long. Use proper accessors
instead of overlapping readings.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220726142048.4494-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
b82217e7 65f79b50

+2 -3
+2 -3
drivers/iio/pressure/dlhl60d.c
··· 129 129 if (ret) 130 130 return ret; 131 131 132 - *pressure = get_unaligned_be32(&st->rx_buf[1]) >> 8; 133 - *temperature = get_unaligned_be32(&st->rx_buf[3]) & 134 - GENMASK(DLH_NUM_TEMP_BITS - 1, 0); 132 + *pressure = get_unaligned_be24(&st->rx_buf[1]); 133 + *temperature = get_unaligned_be24(&st->rx_buf[4]); 135 134 136 135 return 0; 137 136 }