diff mbox series

[v2,1/9] iio: adis_buffer: do not return ints in irq handlers

Message ID 20210422101911.135630-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 22, 2021, 10:19 a.m. UTC
On an IRQ handler we should not return normal error codes as 'irqreturn_t'
is expected.

Fixes: ccd2b52f4ac69 ("staging:iio: Add common ADIS library")
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
 drivers/iio/imu/adis_buffer.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Jonathan Cameron April 24, 2021, 10:59 a.m. UTC | #1
On Thu, 22 Apr 2021 12:19:03 +0200
Nuno Sa <nuno.sa@analog.com> wrote:

> On an IRQ handler we should not return normal error codes as 'irqreturn_t'
> is expected.
> 
> Fixes: ccd2b52f4ac69 ("staging:iio: Add common ADIS library")
> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>

This is an interesting one in the sense it's fixing a bug that can't actually
happen (hence why you can just drop the check ;)  As such I've applied it to
the togreg branch of iio.git and added a note that it doesn't need to
go into stable.

Thanks,

Jonathan

> ---
>  drivers/iio/imu/adis_buffer.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c
> index ac354321f63a..175af154e443 100644
> --- a/drivers/iio/imu/adis_buffer.c
> +++ b/drivers/iio/imu/adis_buffer.c
> @@ -129,9 +129,6 @@ static irqreturn_t adis_trigger_handler(int irq, void *p)
>  	struct adis *adis = iio_device_get_drvdata(indio_dev);
>  	int ret;
>  
> -	if (!adis->buffer)
> -		return -ENOMEM;
> -
>  	if (adis->data->has_paging) {
>  		mutex_lock(&adis->state_lock);
>  		if (adis->current_page != 0) {
diff mbox series

Patch

diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c
index ac354321f63a..175af154e443 100644
--- a/drivers/iio/imu/adis_buffer.c
+++ b/drivers/iio/imu/adis_buffer.c
@@ -129,9 +129,6 @@  static irqreturn_t adis_trigger_handler(int irq, void *p)
 	struct adis *adis = iio_device_get_drvdata(indio_dev);
 	int ret;
 
-	if (!adis->buffer)
-		return -ENOMEM;
-
 	if (adis->data->has_paging) {
 		mutex_lock(&adis->state_lock);
 		if (adis->current_page != 0) {