Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249773
b: refs/heads/master
c: 72b38e3
h: refs/heads/master
i:
  249771: b7b20f6
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed May 19, 2011
1 parent 2dc944c commit 4ff330e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b076b5210870e819d23434bd134cf8d6dddc68c
refs/heads/master: 72b38e3de1e9c9813bfb37ffa23de26e5b703014
3 changes: 3 additions & 0 deletions trunk/drivers/staging/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <linux/device.h>
#include <linux/cdev.h>
#include <linux/irq.h>
#include "sysfs.h"
#include "chrdev.h"

Expand Down Expand Up @@ -376,6 +377,8 @@ void iio_unregister_interrupt_line(struct iio_dev *dev_info,
int line_number);


/* temporarily exported to allow moving of interrupt requesting into drivers */
irqreturn_t iio_interrupt_handler(int irq, void *_int_info);

/**
* iio_push_event() - try to add event to the list for userspace reading
Expand Down
17 changes: 3 additions & 14 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand All @@ -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) {
Expand All @@ -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;
}
Expand All @@ -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);
Expand Down

0 comments on commit 4ff330e

Please sign in to comment.