[PATCH 2/9] staging:iio: simplify logic in iio_interrupt_handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jonathan Cameron <jic23@xxxxxxxxx>
---
 drivers/staging/iio/industrialio-core.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
index 48a2884..406f861 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;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux