Commit 3425c0f7ac61f2fcfb7f2728e9b7ba7e27aec429
1 parent
c5fe7a41ad
Exists in
master
and in
16 other branches
iio:imu:adis16400 fix pressure channel scan type
A single channel in this driver was using the IIO_ST macro. This does not provide a parameter for setting the endianness of the channel. Thus this channel will have been reported as whatever is the native endianness of the cpu rather than big endian. This means it would be incorrect on little endian platforms. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: stable@vger.kernel.org
Showing 1 changed file with 6 additions and 1 deletions Side-by-side Diff
drivers/iio/imu/adis16400_core.c
... | ... | @@ -651,7 +651,12 @@ |
651 | 651 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), |
652 | 652 | .address = ADIS16448_BARO_OUT, |
653 | 653 | .scan_index = ADIS16400_SCAN_BARO, |
654 | - .scan_type = IIO_ST('s', 16, 16, 0), | |
654 | + .scan_type = { | |
655 | + .sign = 's', | |
656 | + .realbits = 16, | |
657 | + .storagebits = 16, | |
658 | + .endianness = IIO_BE, | |
659 | + }, | |
655 | 660 | }, |
656 | 661 | ADIS16400_TEMP_CHAN(ADIS16448_TEMP_OUT, 12), |
657 | 662 | IIO_CHAN_SOFT_TIMESTAMP(11) |