summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@kernel.org>2013-12-11 18:45:00 +0000
committerJonathan Cameron <jic23@kernel.org>2013-12-17 21:50:54 +0000
commit83d5f3246fc05a629278240c09688fd9960b97db (patch)
tree6ca2e930b969763a41cdea7e024a5e2c6154e2d7
parentc6236c0ce39c809c336ca929f68cf8ad02cf94e0 (diff)
downloadop-kernel-dev-83d5f3246fc05a629278240c09688fd9960b97db.zip
op-kernel-dev-83d5f3246fc05a629278240c09688fd9960b97db.tar.gz
staging:iio:ad799x fix incorrect endianness specification for buffer elements
Due to use of the IIO_ST macro, the endianness element of scan_type was not being set. The result is that it will default to the cpu endianness whereas this driver will fill the buffer with big endian data. Thus for little endian machines, userspace will miss interpret the data. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
-rw-r--r--drivers/staging/iio/adc/ad799x_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
index 9428be8..bad4c8a 100644
--- a/drivers/staging/iio/adc/ad799x_core.c
+++ b/drivers/staging/iio/adc/ad799x_core.c
@@ -409,7 +409,13 @@ static const struct iio_event_spec ad799x_events[] = {
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
.scan_index = (_index), \
- .scan_type = IIO_ST('u', _realbits, 16, 12 - (_realbits)), \
+ .scan_type = { \
+ .sign = 'u', \
+ .realbits = (_realbits), \
+ .storagebits = 16, \
+ .shift = 12 - (_realbits), \
+ .endianness = IIO_BE, \
+ }, \
.event_spec = _ev_spec, \
.num_event_specs = _num_ev_spec, \
}
OpenPOWER on IntegriCloud