iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot()
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Mon, 1 Jan 2018 18:54:42 +0000 (19:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Mar 2018 16:24:49 +0000 (18:24 +0200)
commitaf00a24c9ea2a1cc16ba38560a5b3ea404ff3c09
treecb05857531dffd84d47eeac7321c3cd5bd9d041b
parentc7d20ac820ad4598bd256846a7272cf418cf105f
iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot()

commit 7b9ebe428266fb7e0a6d769bb3ff3fcb6044b15e upstream.

Apply le16_to_cpu() to data read from the sensor in order to take into
account architecture endianness

Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c