[PATCH 06/13] staging: comedi: pcmuio: pcmuio_handle_asic_interrupt() does not need the subdevice
H Hartley Sweeten
hsweeten at visionengravers.com
Wed Jul 24 18:47:34 UTC 2013
The comedi_subdevice pointer is not used in this function. Its simply
passed on to pcmuio_handle_intr_subdev(). That function then needs to
calculate the 'asic' associated with the subdevice. Just pass on the
'asic' instead and let pcmuio_handle_intr_subdev() get the subdevice
from that.
Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
drivers/staging/comedi/drivers/pcmuio.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index 82478ed..076a08a 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -284,13 +284,12 @@ static void pcmuio_stop_intr(struct comedi_device *dev,
}
static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
- struct comedi_subdevice *s,
- unsigned triggered)
+ int asic, unsigned triggered)
{
struct pcmuio_private *devpriv = dev->private;
+ struct comedi_subdevice *s = &dev->subdevices[asic * 2];
unsigned int len = s->async->cmd.chanlist_len;
unsigned oldevents = s->async->events;
- int asic = s->index / 2;
unsigned int val = 0;
unsigned long flags;
unsigned mytrig;
@@ -345,7 +344,6 @@ done:
static int pcmuio_handle_asic_interrupt(struct comedi_device *dev, int asic)
{
- struct comedi_subdevice *s = &dev->subdevices[asic * 2];
unsigned long iobase = dev->iobase + (asic * PCMUIO_ASIC_IOSIZE);
unsigned int val;
@@ -359,7 +357,7 @@ static int pcmuio_handle_asic_interrupt(struct comedi_device *dev, int asic)
pcmuio_write(dev, 0, asic, PCMUIO_PAGE_INT_ID, 0);
/* handle the pending interrupts */
- pcmuio_handle_intr_subdev(dev, s, val);
+ pcmuio_handle_intr_subdev(dev, asic, val);
return 1;
}
--
1.8.3.2
More information about the devel
mailing list