aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2010-09-04 17:54:44 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-04 21:18:59 -0700
commitb6e5d69a9e74e08e7f29275797ed9f347c1cde6b (patch)
treeb11f35e5e8af8acae46d3fdcc26bbe2b722990f6
parentb156cf70e1f4befc4856baaf9681dede9a143888 (diff)
downloadmrst-s0i3-test-b6e5d69a9e74e08e7f29275797ed9f347c1cde6b.tar.gz
mrst-s0i3-test-b6e5d69a9e74e08e7f29275797ed9f347c1cde6b.tar.xz
mrst-s0i3-test-b6e5d69a9e74e08e7f29275797ed9f347c1cde6b.zip
staging: iio: simplify logic in iio_interrupt_handler
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/iio/industrialio-core.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
index 48a288473be..406f8613c7a 100644
--- a/drivers/staging/iio/industrialio-core.c
+++ b/drivers/staging/iio/industrialio-core.c
@@ -125,19 +125,10 @@ static irqreturn_t iio_interrupt_handler(int irq, void *_int_info)
}
time_ns = iio_get_time_ns();
- /* detect single element list*/
- if (list_is_singular(&int_info->ev_list)) {
+ list_for_each_entry(p, &int_info->ev_list, list) {
disable_irq_nosync(irq);
- p = list_first_entry(&int_info->ev_list,
- struct iio_event_handler_list,
- list);
- /* single event handler - maybe shared */
p->handler(dev_info, 1, time_ns, !(p->refcount > 1));
- } else
- list_for_each_entry(p, &int_info->ev_list, list) {
- disable_irq_nosync(irq);
- p->handler(dev_info, 1, time_ns, 0);
- }
+ }
spin_unlock_irqrestore(&int_info->ev_list_lock, flags);
return IRQ_HANDLED;