public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iio: imu: inv_mpu6050: Remove duplicate code between labels
@ 2024-09-01 12:08 Gyeyoung Baek
  2024-09-01 14:11 ` Jonathan Cameron
  2024-09-03 23:28 ` Andy Shevchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Gyeyoung Baek @ 2024-09-01 12:08 UTC (permalink / raw)
  To: jic23; +Cc: lars, jean-baptiste.maneyrol, linux-iio, linux-kernel,
	Gyeyoung Baek

'flush_fifo' label performs same task as 'endsession' label
immediately after calling 'env_reset_fifo' function.
So i remove that duplication.

Signed-off-by: Gyeyoung Baek <gye976@gmail.com>
---
I worked on the wrong branch in v1, and reworked on the latest branch.

 drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
index 3d3b27f28c9d..4753016d6ee0 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
@@ -121,15 +121,12 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
 		iio_push_to_buffers_with_timestamp(indio_dev, data, timestamp);
 	}
 
-end_session:
-	mutex_unlock(&st->lock);
-	iio_trigger_notify_done(indio_dev->trig);
-
-	return IRQ_HANDLED;
 
 flush_fifo:
 	/* Flush HW and SW FIFOs. */
 	inv_reset_fifo(indio_dev);
+
+end_session:
 	mutex_unlock(&st->lock);
 	iio_trigger_notify_done(indio_dev->trig);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-03 23:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-01 12:08 [PATCH v2] iio: imu: inv_mpu6050: Remove duplicate code between labels Gyeyoung Baek
2024-09-01 14:11 ` Jonathan Cameron
2024-09-02  1:53   ` gyeyoung
2024-09-02  9:51     ` Jean-Baptiste Maneyrol
2024-09-02 13:35   ` Markus Elfring
2024-09-03 23:28 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox