Patch "iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw

to the 5.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-inv_mpu6050-fix-an-error-code-problem-in-inv.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d16b8138d866e9a72196b9d691651e5e8c751dd4
Author: Su Hui <suhui@xxxxxxxxxxxx>
Date:   Mon Oct 30 10:02:19 2023 +0800

    iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw
    
    [ Upstream commit c3df0e29fb7788c4b3ddf37d5ed87dda2b822943 ]
    
    inv_mpu6050_sensor_show() can return -EINVAL or IIO_VAL_INT. Return the
    true value rather than only return IIO_VAL_INT.
    
    Fixes: d5098447147c ("iio: imu: mpu6050: add calibration offset support")
    Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231030020218.65728-1-suhui@xxxxxxxxxxxx
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 597768c29a729..caeef03b8c622 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -727,13 +727,13 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev,
 			ret = inv_mpu6050_sensor_show(st, st->reg->gyro_offset,
 						chan->channel2, val);
 			mutex_unlock(&st->lock);
-			return IIO_VAL_INT;
+			return ret;
 		case IIO_ACCEL:
 			mutex_lock(&st->lock);
 			ret = inv_mpu6050_sensor_show(st, st->reg->accl_offset,
 						chan->channel2, val);
 			mutex_unlock(&st->lock);
-			return IIO_VAL_INT;
+			return ret;
 
 		default:
 			return -EINVAL;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux