This is a note to let you know that I've just added the patch titled iio: accel: adxl380: fix raw sample read to the 6.12-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-accel-adxl380-fix-raw-sample-read.patch and it can be found in the queue-6.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 5088d7be143333aada4e4b476e6489f240cc8c4e Author: Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx> Date: Fri Nov 1 11:52:01 2024 +0200 iio: accel: adxl380: fix raw sample read [ Upstream commit bfa335f18d91c52fa0f8ba3e4d49afebbd9ee792 ] The adxl380_read_chn function returns either a negative value in case an error occurs or the actual sample. Check only for negative values after a channel is read. Fixes: df36de13677a ("iio: accel: add ADXL380 driver") Signed-off-by: Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx> Link: https://patch.msgid.link/20241101095202.20121-1-antoniu.miclaus@xxxxxxxxxx Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/iio/accel/adxl380.c b/drivers/iio/accel/adxl380.c index f80527d899be4..b19ee37df7f12 100644 --- a/drivers/iio/accel/adxl380.c +++ b/drivers/iio/accel/adxl380.c @@ -1181,7 +1181,7 @@ static int adxl380_read_raw(struct iio_dev *indio_dev, ret = adxl380_read_chn(st, chan->address); iio_device_release_direct_mode(indio_dev); - if (ret) + if (ret < 0) return ret; *val = sign_extend32(ret >> chan->scan_type.shift,