Commit 67bd5e26 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron

staging:iio:accel:adis16xxx: Do not return error code in the interrupt handler

The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 0b30246e
...@@ -70,7 +70,7 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p) ...@@ -70,7 +70,7 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) { if (data == NULL) {
dev_err(&st->us->dev, "memory alloc failed in ring bh"); dev_err(&st->us->dev, "memory alloc failed in ring bh");
return -ENOMEM; goto done;
} }
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)
...@@ -85,8 +85,9 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p) ...@@ -85,8 +85,9 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p)
ring->access->store_to(ring, (u8 *)data, pf->timestamp); ring->access->store_to(ring, (u8 *)data, pf->timestamp);
iio_trigger_notify_done(indio_dev->trig);
kfree(data); kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -69,7 +69,7 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p) ...@@ -69,7 +69,7 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) { if (data == NULL) {
dev_err(&st->us->dev, "memory alloc failed in ring bh"); dev_err(&st->us->dev, "memory alloc failed in ring bh");
return -ENOMEM; goto done;
} }
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) &&
...@@ -86,8 +86,9 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p) ...@@ -86,8 +86,9 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p)
(u8 *)data, (u8 *)data,
pf->timestamp); pf->timestamp);
iio_trigger_notify_done(indio_dev->trig);
kfree(data); kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -66,7 +66,7 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p) ...@@ -66,7 +66,7 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) { if (data == NULL) {
dev_err(&st->us->dev, "memory alloc failed in ring bh"); dev_err(&st->us->dev, "memory alloc failed in ring bh");
return -ENOMEM; goto done;
} }
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) &&
...@@ -81,8 +81,9 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p) ...@@ -81,8 +81,9 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p)
ring->access->store_to(ring, (u8 *)data, pf->timestamp); ring->access->store_to(ring, (u8 *)data, pf->timestamp);
iio_trigger_notify_done(indio_dev->trig);
kfree(data); kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -66,7 +66,7 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p) ...@@ -66,7 +66,7 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) { if (data == NULL) {
dev_err(&st->us->dev, "memory alloc failed in ring bh"); dev_err(&st->us->dev, "memory alloc failed in ring bh");
return -ENOMEM; goto done;
} }
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) &&
...@@ -81,8 +81,9 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p) ...@@ -81,8 +81,9 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p)
ring->access->store_to(ring, (u8 *)data, pf->timestamp); ring->access->store_to(ring, (u8 *)data, pf->timestamp);
iio_trigger_notify_done(indio_dev->trig);
kfree(data); kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -64,7 +64,7 @@ static irqreturn_t adis16240_trigger_handler(int irq, void *p) ...@@ -64,7 +64,7 @@ static irqreturn_t adis16240_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) { if (data == NULL) {
dev_err(&st->us->dev, "memory alloc failed in ring bh"); dev_err(&st->us->dev, "memory alloc failed in ring bh");
return -ENOMEM; goto done;
} }
if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) &&
...@@ -79,8 +79,9 @@ static irqreturn_t adis16240_trigger_handler(int irq, void *p) ...@@ -79,8 +79,9 @@ static irqreturn_t adis16240_trigger_handler(int irq, void *p)
ring->access->store_to(ring, (u8 *)data, pf->timestamp); ring->access->store_to(ring, (u8 *)data, pf->timestamp);
iio_trigger_notify_done(indio_dev->trig);
kfree(data); kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment