Skip to contentSkip to conversation

Patch "iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot()" has been added to the 4.15-stable tree

PATCH [email protected] 1 participant 1 message Mar 27, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot()

to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
iio-imu-st_lsm6dsx-fix-endianness-in-st_lsm6dsx_read_oneshot.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 7b9ebe428266fb7e0a6d769bb3ff3fcb6044b15e Mon Sep 17 00:00:00 2001

From: Lorenzo Bianconi <[email protected]>
Date: Mon, 1 Jan 2018 19:54:42 +0100
Subject: iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot()

From: Lorenzo Bianconi <[email protected]>

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)
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +1 -1
@@ -448,7 +448,7 @@ static int st_lsm6dsx_read_oneshot(struc
 
 	st_lsm6dsx_sensor_disable(sensor);
 
-	*val = (s16)data;
+	*val = (s16)le16_to_cpu(data);
 
 	return IIO_VAL_INT;
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.15/iio-imu-st_lsm6dsx-fix-endianness-in-st_lsm6dsx_read_oneshot.patch queue-4.15/iio-imu-st_lsm6dsx-introduce-conf_lock-mutex.patch