Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83d5f324 authored by Jonathan Cameron's avatar Jonathan Cameron
Browse files

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: default avatarJonathan Cameron <jic23@kernel.org>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
parent c6236c0c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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, \
}