summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/industrialio-core.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-05-18 14:40:59 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-19 16:06:12 -0700
commit72b38e3de1e9c9813bfb37ffa23de26e5b703014 (patch)
tree75d5506668a03d1b61d26524bb98f914c93d126a /drivers/staging/iio/industrialio-core.c
parent1b076b5210870e819d23434bd134cf8d6dddc68c (diff)
downloadop-kernel-dev-72b38e3de1e9c9813bfb37ffa23de26e5b703014.zip
op-kernel-dev-72b38e3de1e9c9813bfb37ffa23de26e5b703014.tar.gz
staging:iio: Push interrupt setup down into the drivers for event lines.
It is much easier to do in driver, and the core does not add much. Note all drivers will have to be updated with this patch. None currently are. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/industrialio-core.c')
-rw-r--r--drivers/staging/iio/industrialio-core.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
index 9ddd6a6..136ff04 100644
--- a/drivers/staging/iio/industrialio-core.c
+++ b/drivers/staging/iio/industrialio-core.c
@@ -134,7 +134,7 @@ int iio_push_event(struct iio_dev *dev_info,
EXPORT_SYMBOL(iio_push_event);
/* Generic interrupt line interrupt handler */
-static irqreturn_t iio_interrupt_handler(int irq, void *_int_info)
+irqreturn_t iio_interrupt_handler(int irq, void *_int_info)
{
struct iio_interrupt *int_info = _int_info;
struct iio_dev *dev_info = int_info->dev_info;
@@ -157,6 +157,7 @@ static irqreturn_t iio_interrupt_handler(int irq, void *_int_info)
return IRQ_HANDLED;
}
+EXPORT_SYMBOL(iio_interrupt_handler);
static struct iio_interrupt *iio_allocate_interrupt(void)
{
@@ -175,7 +176,7 @@ int iio_register_interrupt_line(unsigned int irq,
unsigned long type,
const char *name)
{
- int ret;
+ int ret = 0;
dev_info->interrupts[line_number] = iio_allocate_interrupt();
if (dev_info->interrupts[line_number] == NULL) {
@@ -186,16 +187,6 @@ int iio_register_interrupt_line(unsigned int irq,
dev_info->interrupts[line_number]->irq = irq;
dev_info->interrupts[line_number]->dev_info = dev_info;
- /* Possibly only request on demand?
- * Can see this may complicate the handling of interrupts.
- * However, with this approach we might end up handling lots of
- * events no-one cares about.*/
- ret = request_irq(irq,
- &iio_interrupt_handler,
- type,
- name,
- dev_info->interrupts[line_number]);
-
error_ret:
return ret;
}
@@ -215,8 +206,6 @@ void iio_unregister_interrupt_line(struct iio_dev *dev_info, int line_number)
{
/* make sure the interrupt handlers are all done */
flush_scheduled_work();
- free_irq(dev_info->interrupts[line_number]->irq,
- dev_info->interrupts[line_number]);
kfree(dev_info->interrupts[line_number]);
}
EXPORT_SYMBOL(iio_unregister_interrupt_line);
OpenPOWER on IntegriCloud