diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-07-04 17:09:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-07-08 20:02:31 +0100 |
commit | 462c8d27940d1d41f76091544245b0af11b64c81 (patch) | |
tree | 897adde84311ddd37b324ade92c3e7709b7f19a9 /drivers/staging/iio | |
parent | b82ed7d6805ef2a31503999edc80787083d4426f (diff) | |
download | linux-462c8d27940d1d41f76091544245b0af11b64c81.tar.bz2 |
staging:iio:adis16400: 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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/imu/adis16400_ring.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/staging/iio/imu/adis16400_ring.c b/drivers/staging/iio/imu/adis16400_ring.c index 809e2c4270d1..beec650ddbdb 100644 --- a/drivers/staging/iio/imu/adis16400_ring.c +++ b/drivers/staging/iio/imu/adis16400_ring.c @@ -125,20 +125,20 @@ static irqreturn_t adis16400_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 (scan_count) { if (st->variant->flags & ADIS16400_NO_BURST) { ret = adis16350_spi_read_all(indio_dev, st->rx); if (ret < 0) - goto err; + goto done; for (; i < scan_count; i++) data[i] = *(s16 *)(st->rx + i*2); } else { ret = adis16400_spi_read_burst(indio_dev, st->rx); if (ret < 0) - goto err; + goto done; for (; i < scan_count; i++) { j = __ffs(mask); mask &= ~(1 << j); @@ -152,14 +152,11 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; ring->access->store_to(indio_dev->buffer, (u8 *) data, pf->timestamp); +done: + kfree(data); iio_trigger_notify_done(indio_dev->trig); - kfree(data); return IRQ_HANDLED; - -err: - kfree(data); - return ret; } void adis16400_unconfigure_ring(struct iio_dev *indio_dev) |