[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7555437b-9289-eba4-efa8-965386e0e956@nfschina.com>
Date: Mon, 30 Oct 2023 10:10:05 +0800
From: Su Hui <suhui@...china.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Jonathan.Cameron@...wei.com, lars@...afoo.de,
jean-baptiste.maneyrol@....com, andy.shevchenko@...il.com,
chenhuiz@...s.com, linux-iio@...r.kernel.org,
linux-kernel@...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
On 2023/10/27 21:59, Jonathan Cameron wrote:
> On Mon, 23 Oct 2023 12:05:52 +0800
> Su Hui <suhui@...china.com> wrote:
>
>> 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>
> If you can figure out a fixes tag that would be great. Just reply to this thread
> with it and I'll pick it up from here.
Oh, I just send a v3 patch, sorry....
Fixes: d5098447147c ("iio: imu: mpu6050: add calibration offset support")
>> ---
>> v2:
>> - fix the error of commit title.
>> v1:
>> - https://lore.kernel.org/all/20231020091413.205743-2-suhui@nfschina.com/
>> 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;
Powered by blists - more mailing lists