diff mbox series

[1/7] iio: adis_buffer: do not return ints in irq handlers

Message ID 20210413112105.69458-2-nuno.sa@analog.com (mailing list archive)
State New, archived
Headers show
Series Adis IRQ fixes and minor improvements | expand

Commit Message

Nuno Sa April 13, 2021, 11:20 a.m. UTC
On an IRQ handler we should return normal error codes as 'irqreturn_t'
is expected.

Fixes: ccd2b52f4ac69 ("staging:iio: Add common ADIS library")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
 drivers/iio/imu/adis_buffer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Alexandru Ardelean April 14, 2021, 7:23 a.m. UTC | #1
On Tue, Apr 13, 2021 at 5:45 PM Nuno Sa <nuno.sa@analog.com> wrote:
>
> On an IRQ handler we should return normal error codes as 'irqreturn_t'
> is expected.
>

Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>

> Fixes: ccd2b52f4ac69 ("staging:iio: Add common ADIS library")
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> ---
>  drivers/iio/imu/adis_buffer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c
> index ac354321f63a..f89bce10090a 100644
> --- a/drivers/iio/imu/adis_buffer.c
> +++ b/drivers/iio/imu/adis_buffer.c
> @@ -130,7 +130,7 @@ static irqreturn_t adis_trigger_handler(int irq, void *p)
>         int ret;
>
>         if (!adis->buffer)
> -               return -ENOMEM;
> +               goto irq_done;
>
>         if (adis->data->has_paging) {
>                 mutex_lock(&adis->state_lock);
> @@ -154,6 +154,7 @@ static irqreturn_t adis_trigger_handler(int irq, void *p)
>         iio_push_to_buffers_with_timestamp(indio_dev, adis->buffer,
>                 pf->timestamp);
>
> +irq_done:
>         iio_trigger_notify_done(indio_dev->trig);
>
>         return IRQ_HANDLED;
> --
> 2.31.1
>
diff mbox series

Patch

diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c
index ac354321f63a..f89bce10090a 100644
--- a/drivers/iio/imu/adis_buffer.c
+++ b/drivers/iio/imu/adis_buffer.c
@@ -130,7 +130,7 @@  static irqreturn_t adis_trigger_handler(int irq, void *p)
 	int ret;
 
 	if (!adis->buffer)
-		return -ENOMEM;
+		goto irq_done;
 
 	if (adis->data->has_paging) {
 		mutex_lock(&adis->state_lock);
@@ -154,6 +154,7 @@  static irqreturn_t adis_trigger_handler(int irq, void *p)
 	iio_push_to_buffers_with_timestamp(indio_dev, adis->buffer,
 		pf->timestamp);
 
+irq_done:
 	iio_trigger_notify_done(indio_dev->trig);
 
 	return IRQ_HANDLED;