[[Xenial][SRU] 2/4] iio:st_pressure: align storagebits on power of 2

Shrirang Bagul shrirang.bagul at canonical.com
Fri Nov 25 04:31:08 UTC 2016


From: Gregor Boirie <gregor.boirie at parrot.com>

BugLink: https://launchpad.net/bugs/1642258

Sampled pressure data are 24 bits long and should be stored in a 32 bits
word.

Signed-off-by: Gregor Boirie <gregor.boirie at parrot.com>
Tested-by: Linus Walleij <linus.walleij at linaro.org>
Signed-off-by: Jonathan Cameron <jic23 at kernel.org>
(backported from commit c9d5e5b97e8723e20204b430edde2f3dc5f5c0cf)
Signed-off-by: Shrirang Bagul <shrirang.bagul at canonical.com>
---
 drivers/iio/pressure/st_pressure_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index ecf3cd4..8532181 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -138,7 +138,7 @@ static const struct iio_chan_spec st_press_1_channels[] = {
 		.scan_type = {
 			.sign = 'u',
 			.realbits = 24,
-			.storagebits = 24,
+			.storagebits = 32,
 			.endianness = IIO_LE,
 		},
 		.info_mask_separate =
@@ -210,7 +210,7 @@ static const struct iio_chan_spec st_press_lps22hb_channels[] = {
 		.scan_type = {
 			.sign = 'u',
 			.realbits = 24,
-			.storagebits = 24,
+			.storagebits = 32,
 			.endianness = IIO_LE,
 		},
 		.info_mask_separate =
-- 
2.9.3





More information about the kernel-team mailing list