linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: imu: st_lsm6dsx: flip irq return logic
@ 2019-07-15  7:07 Sean Nyekjaer
  2019-07-27 21:16 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Nyekjaer @ 2019-07-15  7:07 UTC (permalink / raw)
  To: linux-iio, jic23; +Cc: Sean Nyekjaer, lorenzo.bianconi83, martin

No need for using reverse logic in the irq return,
fix this by flip things around.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index 38194f4d2b7e..1be1cec2ab23 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -670,7 +670,7 @@ static irqreturn_t st_lsm6dsx_handler_thread(int irq, void *private)
 	count = hw->settings->fifo_ops.read_fifo(hw);
 	mutex_unlock(&hw->fifo_lock);
 
-	return !count ? IRQ_NONE : IRQ_HANDLED;
+	return count ? IRQ_HANDLED : IRQ_NONE;
 }
 
 static int st_lsm6dsx_buffer_preenable(struct iio_dev *iio_dev)
-- 
2.22.0


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

* Re: [PATCH] iio: imu: st_lsm6dsx: flip irq return logic
  2019-07-15  7:07 [PATCH] iio: imu: st_lsm6dsx: flip irq return logic Sean Nyekjaer
@ 2019-07-27 21:16 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-07-27 21:16 UTC (permalink / raw)
  To: Sean Nyekjaer; +Cc: linux-iio, lorenzo.bianconi83, martin

On Mon, 15 Jul 2019 09:07:15 +0200
Sean Nyekjaer <sean@geanix.com> wrote:

> No need for using reverse logic in the irq return,
> fix this by flip things around.
> 
> Signed-off-by: Sean Nyekjaer <sean@geanix.com>

This is indeed rather strange! Code evolution I guess ;)

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> index 38194f4d2b7e..1be1cec2ab23 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> @@ -670,7 +670,7 @@ static irqreturn_t st_lsm6dsx_handler_thread(int irq, void *private)
>  	count = hw->settings->fifo_ops.read_fifo(hw);
>  	mutex_unlock(&hw->fifo_lock);
>  
> -	return !count ? IRQ_NONE : IRQ_HANDLED;
> +	return count ? IRQ_HANDLED : IRQ_NONE;
>  }
>  
>  static int st_lsm6dsx_buffer_preenable(struct iio_dev *iio_dev)


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

end of thread, other threads:[~2019-07-27 21:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15  7:07 [PATCH] iio: imu: st_lsm6dsx: flip irq return logic Sean Nyekjaer
2019-07-27 21:16 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).