]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging:iio:accel:adis16xxx: Do not return error code in the interrupt handler
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 4 Jul 2012 16:09:00 +0000 (17:09 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 8 Jul 2012 19:02:30 +0000 (20:02 +0100)
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>
drivers/staging/iio/accel/adis16201_ring.c
drivers/staging/iio/accel/adis16203_ring.c
drivers/staging/iio/accel/adis16204_ring.c
drivers/staging/iio/accel/adis16209_ring.c
drivers/staging/iio/accel/adis16240_ring.c

index 247602a8e54cecbdea46c3fcc7531ef648fc98aa..03fcf6e319db65ecde366d39fb5d407c6794ed9d 100644 (file)
@@ -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;
 }
index 7bbd2c2bbd197831d97178cb8ae0f8abdc688b95..c16b2b7323ac2e500c7d377f59a5e37faa3c87f3 100644 (file)
@@ -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;
 }
index f73518bc65877a99d2844c1a5cef93dc10845909..1d2b31cc849e81428ef6e061146ca31d1a55395a 100644 (file)
@@ -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;
 }
index 090607504c937ebeba25731a3eb2af8212f84805..1a4a55c27c7c7795fbe9370afee5a5fdf98036c3 100644 (file)
@@ -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;
 }
index 86a2a4757ea7958c87944151ed9750bd98652e94..360dfed6d4d15022b25a416754495804cfc0f336 100644 (file)
@@ -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;
 }