Skip to content

Commit c3df0e2

Browse files
Su Huijic23
authored andcommitted
iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw
inv_mpu6050_sensor_show() can return -EINVAL or IIO_VAL_INT. Return the true value rather than only return IIO_VAL_INT. Fixes: d509844 ("iio: imu: mpu6050: add calibration offset support") Signed-off-by: Su Hui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 1cd2fe4 commit c3df0e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/imu/inv_mpu6050/inv_mpu_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,13 +750,13 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev,
750750
ret = inv_mpu6050_sensor_show(st, st->reg->gyro_offset,
751751
chan->channel2, val);
752752
mutex_unlock(&st->lock);
753-
return IIO_VAL_INT;
753+
return ret;
754754
case IIO_ACCEL:
755755
mutex_lock(&st->lock);
756756
ret = inv_mpu6050_sensor_show(st, st->reg->accl_offset,
757757
chan->channel2, val);
758758
mutex_unlock(&st->lock);
759-
return IIO_VAL_INT;
759+
return ret;
760760

761761
default:
762762
return -EINVAL;

0 commit comments

Comments
 (0)