diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-07-04 16:09:00 (GMT) |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-07-08 19:02:30 (GMT) |
commit | 67bd5e26d44a5282d46719325b25deedebc39b2e (patch) | |
tree | 3f90f2cb227feeee3f79e5ff2488e51aed4781de /drivers/staging/iio | |
parent | 0b30246ef17c2e37819068aec3d5eac4ac06b562 (diff) | |
download | linux-fsl-qoriq-67bd5e26d44a5282d46719325b25deedebc39b2e.tar.xz |
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: 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/accel/adis16201_ring.c | 5 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16203_ring.c | 5 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16204_ring.c | 5 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16209_ring.c | 5 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16240_ring.c | 5 |
5 files changed, 15 insertions, 10 deletions
diff --git a/drivers/staging/iio/accel/adis16201_ring.c b/drivers/staging/iio/accel/adis16201_ring.c index 247602a..03fcf6e 100644 --- a/drivers/staging/iio/accel/adis16201_ring.c +++ b/drivers/staging/iio/accel/adis16201_ring.c @@ -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) @@ -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; } diff --git a/drivers/staging/iio/accel/adis16203_ring.c b/drivers/staging/iio/accel/adis16203_ring.c index 7bbd2c2..c16b2b7 100644 --- a/drivers/staging/iio/accel/adis16203_ring.c +++ b/drivers/staging/iio/accel/adis16203_ring.c @@ -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) && @@ -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; } diff --git a/drivers/staging/iio/accel/adis16204_ring.c b/drivers/staging/iio/accel/adis16204_ring.c index f73518b..1d2b31c 100644 --- a/drivers/staging/iio/accel/adis16204_ring.c +++ b/drivers/staging/iio/accel/adis16204_ring.c @@ -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) && @@ -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; } diff --git a/drivers/staging/iio/accel/adis16209_ring.c b/drivers/staging/iio/accel/adis16209_ring.c index 0906075..1a4a55c 100644 --- a/drivers/staging/iio/accel/adis16209_ring.c +++ b/drivers/staging/iio/accel/adis16209_ring.c @@ -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) && @@ -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; } diff --git a/drivers/staging/iio/accel/adis16240_ring.c b/drivers/staging/iio/accel/adis16240_ring.c index 86a2a47..360dfed 100644 --- a/drivers/staging/iio/accel/adis16240_ring.c +++ b/drivers/staging/iio/accel/adis16240_ring.c @@ -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) && @@ -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; } |