Commit 67bd5e26d44a5282d46719325b25deedebc39b2e
Committed by
Jonathan Cameron
1 parent
0b30246ef1
Exists in
master
and in
20 other branches
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>
Showing 5 changed files with 15 additions and 10 deletions Side-by-side Diff
drivers/staging/iio/accel/adis16201_ring.c
| ... | ... | @@ -70,7 +70,7 @@ |
| 70 | 70 | data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); |
| 71 | 71 | if (data == NULL) { |
| 72 | 72 | dev_err(&st->us->dev, "memory alloc failed in ring bh"); |
| 73 | - return -ENOMEM; | |
| 73 | + goto done; | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) |
| 77 | 77 | |
| ... | ... | @@ -85,8 +85,9 @@ |
| 85 | 85 | |
| 86 | 86 | ring->access->store_to(ring, (u8 *)data, pf->timestamp); |
| 87 | 87 | |
| 88 | - iio_trigger_notify_done(indio_dev->trig); | |
| 89 | 88 | kfree(data); |
| 89 | +done: | |
| 90 | + iio_trigger_notify_done(indio_dev->trig); | |
| 90 | 91 | |
| 91 | 92 | return IRQ_HANDLED; |
| 92 | 93 | } |
drivers/staging/iio/accel/adis16203_ring.c
| ... | ... | @@ -69,7 +69,7 @@ |
| 69 | 69 | data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); |
| 70 | 70 | if (data == NULL) { |
| 71 | 71 | dev_err(&st->us->dev, "memory alloc failed in ring bh"); |
| 72 | - return -ENOMEM; | |
| 72 | + goto done; | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && |
| 76 | 76 | |
| ... | ... | @@ -86,8 +86,9 @@ |
| 86 | 86 | (u8 *)data, |
| 87 | 87 | pf->timestamp); |
| 88 | 88 | |
| 89 | - iio_trigger_notify_done(indio_dev->trig); | |
| 90 | 89 | kfree(data); |
| 90 | +done: | |
| 91 | + iio_trigger_notify_done(indio_dev->trig); | |
| 91 | 92 | |
| 92 | 93 | return IRQ_HANDLED; |
| 93 | 94 | } |
drivers/staging/iio/accel/adis16204_ring.c
| ... | ... | @@ -66,7 +66,7 @@ |
| 66 | 66 | data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); |
| 67 | 67 | if (data == NULL) { |
| 68 | 68 | dev_err(&st->us->dev, "memory alloc failed in ring bh"); |
| 69 | - return -ENOMEM; | |
| 69 | + goto done; | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && |
| 73 | 73 | |
| ... | ... | @@ -81,8 +81,9 @@ |
| 81 | 81 | |
| 82 | 82 | ring->access->store_to(ring, (u8 *)data, pf->timestamp); |
| 83 | 83 | |
| 84 | - iio_trigger_notify_done(indio_dev->trig); | |
| 85 | 84 | kfree(data); |
| 85 | +done: | |
| 86 | + iio_trigger_notify_done(indio_dev->trig); | |
| 86 | 87 | |
| 87 | 88 | return IRQ_HANDLED; |
| 88 | 89 | } |
drivers/staging/iio/accel/adis16209_ring.c
| ... | ... | @@ -66,7 +66,7 @@ |
| 66 | 66 | data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); |
| 67 | 67 | if (data == NULL) { |
| 68 | 68 | dev_err(&st->us->dev, "memory alloc failed in ring bh"); |
| 69 | - return -ENOMEM; | |
| 69 | + goto done; | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && |
| 73 | 73 | |
| ... | ... | @@ -81,8 +81,9 @@ |
| 81 | 81 | |
| 82 | 82 | ring->access->store_to(ring, (u8 *)data, pf->timestamp); |
| 83 | 83 | |
| 84 | - iio_trigger_notify_done(indio_dev->trig); | |
| 85 | 84 | kfree(data); |
| 85 | +done: | |
| 86 | + iio_trigger_notify_done(indio_dev->trig); | |
| 86 | 87 | |
| 87 | 88 | return IRQ_HANDLED; |
| 88 | 89 | } |
drivers/staging/iio/accel/adis16240_ring.c
| ... | ... | @@ -64,7 +64,7 @@ |
| 64 | 64 | data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL); |
| 65 | 65 | if (data == NULL) { |
| 66 | 66 | dev_err(&st->us->dev, "memory alloc failed in ring bh"); |
| 67 | - return -ENOMEM; | |
| 67 | + goto done; | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength) && |
| 71 | 71 | |
| ... | ... | @@ -79,8 +79,9 @@ |
| 79 | 79 | |
| 80 | 80 | ring->access->store_to(ring, (u8 *)data, pf->timestamp); |
| 81 | 81 | |
| 82 | - iio_trigger_notify_done(indio_dev->trig); | |
| 83 | 82 | kfree(data); |
| 83 | +done: | |
| 84 | + iio_trigger_notify_done(indio_dev->trig); | |
| 84 | 85 | |
| 85 | 86 | return IRQ_HANDLED; |
| 86 | 87 | } |