staging:iio:mag:hmc5843 fix incorrect endianness of channel as a result of missuse...
authorJonathan Cameron <jic23@kernel.org>
Wed, 11 Dec 2013 18:45:00 +0000 (18:45 +0000)
committerJonathan Cameron <jic23@kernel.org>
Tue, 17 Dec 2013 20:32:52 +0000 (20:32 +0000)
commitc5fe7a41ad51e0c2df8381e9c85d7343b36b2c1e
tree5e56a97d67f9bdf2a7884d5c369504914c8f7bbe
parent128d6637cce0747e21b8936e449b1c78a497b189
staging:iio:mag:hmc5843 fix incorrect endianness of channel as a result of missuse of the IIO_ST macro.

This driver sets the shift value equal to IIO_BE (or 1) rather than setting
that to 0 and specificying the endianness.  This means the channel type is
missreported as
[be|le]:u16/16>>1 where the be|le is dependent on the cpu native endianness,
rather than
be:u16/16>>0 resulting in any userspace code using this information, miss
converting the channel and generating thoroughly trashed data.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: stable@vger.kernel.org
drivers/staging/iio/magnetometer/hmc5843.c