[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <FR3P281MB17570A319238078822C9C77CCED8A@FR3P281MB1757.DEUP281.PROD.OUTLOOK.COM>
Date: Mon, 23 Oct 2023 12:57:11 +0000
From: Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@....com>
To: Su Hui <suhui@...china.com>,
"Jonathan.Cameron@...wei.com" <Jonathan.Cameron@...wei.com>,
"jic23@...nel.org" <jic23@...nel.org>,
"lars@...afoo.de" <lars@...afoo.de>
CC: "andy.shevchenko@...il.com" <andy.shevchenko@...il.com>,
"chenhuiz@...s.com" <chenhuiz@...s.com>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH v2] iio: imu: inv_mpu6050: fix an error code problem in
inv_mpu6050_read_raw
Hello,
looks good for me, thanks for the fix.
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@....com>
Thanks,
JB
From: Su Hui <suhui@...china.com>
Sent: Monday, October 23, 2023 06:05
To: Jonathan.Cameron@...wei.com <Jonathan.Cameron@...wei.com>; jic23@...nel.org <jic23@...nel.org>; lars@...afoo.de <lars@...afoo.de>
Cc: Su Hui <suhui@...china.com>; Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@....com>; andy.shevchenko@...il.com <andy.shevchenko@...il.com>; chenhuiz@...s.com <chenhuiz@...s.com>; linux-iio@...r.kernel.org <linux-iio@...r.kernel.org>; linux-kernel@...r.kernel.org <linux-kernel@...r.kernel.org>; kernel-janitors@...r.kernel.org <kernel-janitors@...r.kernel.org>
Subject: [PATCH v2] 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. Signed-off-by: Su Hui <suhui@ nfschina. com> --- v2: - fix the error of commit title. v1: - https: //urldefense. com/v3/__https: //lore. kernel. org/all/20231020091413. 205743-2-suhui@ nfschina. com/__;!!FtrhtPsWDhZ6tw!HkhoYyOc-Whx_ROmsl5laocdgPfmACC5Piff96FG_nwTqZFA4GgXeNhp7q1wVElUFbfabAcCmt6D1uuKA1LO1q5E$[lore[. ]kernel[. ]org]
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.
ZjQcmQRYFpfptBannerEnd
inv_mpu6050_sensor_show() can return -EINVAL or IIO_VAL_INT. Return the
true value rather than only return IIO_VAL_INT.
Signed-off-by: Su Hui <suhui@...china.com>
---
v2:
- fix the error of commit title.
v1:
- https://urldefense.com/v3/__https://lore.kernel.org/all/20231020091413.205743-2-suhui@nfschina.com/__;!!FtrhtPsWDhZ6tw!HkhoYyOc-Whx_ROmsl5laocdgPfmACC5Piff96FG_nwTqZFA4GgXeNhp7q1wVElUFbfabAcCmt6D1uuKA1LO1q5E$[lore[.]kernel[.]org]
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 29f906c884bd..a9a5fb266ef1 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -749,13 +749,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;
--
2.30.2
Powered by blists - more mailing lists