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

Commit af00a24c authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Greg Kroah-Hartman
Browse files

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: 290a6ce1 (iio: imu: add support to lsm6dsx driver)
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c7d20ac8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -392,7 +392,7 @@ static int st_lsm6dsx_read_oneshot(struct st_lsm6dsx_sensor *sensor,

	st_lsm6dsx_sensor_disable(sensor);

	*val = (s16)data;
	*val = (s16)le16_to_cpu(data);

	return IIO_VAL_INT;
}