Skip to content

Commit

Permalink
staging:iio:accel:adis16xxx: Do not return error code in the interrup…
Browse files Browse the repository at this point in the history
…t 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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Jul 8, 2012
1 parent 0b30246 commit 67bd5e2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/iio/accel/adis16201_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) {
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)
Expand All @@ -85,8 +85,9 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p)

ring->access->store_to(ring, (u8 *)data, pf->timestamp);

iio_trigger_notify_done(indio_dev->trig);
kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);

return IRQ_HANDLED;
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/iio/accel/adis16203_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) {
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) &&
Expand All @@ -86,8 +86,9 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p)
(u8 *)data,
pf->timestamp);

iio_trigger_notify_done(indio_dev->trig);
kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);

return IRQ_HANDLED;
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/iio/accel/adis16204_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) {
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) &&
Expand All @@ -81,8 +81,9 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p)

ring->access->store_to(ring, (u8 *)data, pf->timestamp);

iio_trigger_notify_done(indio_dev->trig);
kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);

return IRQ_HANDLED;
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/iio/accel/adis16209_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) {
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) &&
Expand All @@ -81,8 +81,9 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p)

ring->access->store_to(ring, (u8 *)data, pf->timestamp);

iio_trigger_notify_done(indio_dev->trig);
kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);

return IRQ_HANDLED;
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/iio/accel/adis16240_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static irqreturn_t adis16240_trigger_handler(int irq, void *p)
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
if (data == NULL) {
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) &&
Expand All @@ -79,8 +79,9 @@ static irqreturn_t adis16240_trigger_handler(int irq, void *p)

ring->access->store_to(ring, (u8 *)data, pf->timestamp);

iio_trigger_notify_done(indio_dev->trig);
kfree(data);
done:
iio_trigger_notify_done(indio_dev->trig);

return IRQ_HANDLED;
}
Expand Down

0 comments on commit 67bd5e2

Please sign in to comment.