diff mbox series

[v2,02/13] iio: imu: inv_mpu6050: delete useless check

Message ID 20200219143958.3548-3-jmaneyrol@invensense.com (mailing list archive)
State New, archived
Headers show
Series Rework sensors engines and power management | expand

Commit Message

Jean-Baptiste Maneyrol Feb. 19, 2020, 2:39 p.m. UTC
If we are here it means we have fifo enabled for 1 sensor
at least. And interrupt is always required for using trigger.

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Comments

Jonathan Cameron Feb. 21, 2020, 11:19 a.m. UTC | #1
On Wed, 19 Feb 2020 15:39:47 +0100
Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> wrote:

> If we are here it means we have fifo enabled for 1 sensor
> at least. And interrupt is always required for using trigger.
> 
> Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> index f9fdf4302a91..d7397705974e 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> @@ -123,14 +123,11 @@ int inv_reset_fifo(struct iio_dev *indio_dev)
>  		goto reset_fifo_fail;
>  
>  	/* enable interrupt */
> -	if (st->chip_config.accl_fifo_enable ||
> -	    st->chip_config.gyro_fifo_enable ||
> -	    st->chip_config.magn_fifo_enable) {
> -		result = regmap_write(st->map, st->reg->int_enable,
> -				      INV_MPU6050_BIT_DATA_RDY_EN);
> -		if (result)
> -			return result;
> -	}
> +	result = regmap_write(st->map, st->reg->int_enable,
> +			      INV_MPU6050_BIT_DATA_RDY_EN);
> +	if (result)
> +		return result;
> +
>  	/* enable FIFO reading */
>  	d = st->chip_config.user_ctrl | INV_MPU6050_BIT_FIFO_EN;
>  	result = regmap_write(st->map, st->reg->user_ctrl, d);
diff mbox series

Patch

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
index f9fdf4302a91..d7397705974e 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
@@ -123,14 +123,11 @@  int inv_reset_fifo(struct iio_dev *indio_dev)
 		goto reset_fifo_fail;
 
 	/* enable interrupt */
-	if (st->chip_config.accl_fifo_enable ||
-	    st->chip_config.gyro_fifo_enable ||
-	    st->chip_config.magn_fifo_enable) {
-		result = regmap_write(st->map, st->reg->int_enable,
-				      INV_MPU6050_BIT_DATA_RDY_EN);
-		if (result)
-			return result;
-	}
+	result = regmap_write(st->map, st->reg->int_enable,
+			      INV_MPU6050_BIT_DATA_RDY_EN);
+	if (result)
+		return result;
+
 	/* enable FIFO reading */
 	d = st->chip_config.user_ctrl | INV_MPU6050_BIT_FIFO_EN;
 	result = regmap_write(st->map, st->reg->user_ctrl, d);