Commit d61b786a authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: adv_pci1710: do comedi_handle_events() in common code patch

The pci1710_handle_every_sample() and pci1710_handle_fifo() helpers, called by
the interrupt handler, both have multiple comedi_handle_events() calls. Remove
these and just do a single comedi_handle_events() at the end of the interrupt
handler.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7fd2dae2
...@@ -666,14 +666,12 @@ static void pci1710_handle_every_sample(struct comedi_device *dev, ...@@ -666,14 +666,12 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
if (status & Status_FE) { if (status & Status_FE) {
dev_dbg(dev->class_dev, "A/D FIFO empty (%4x)\n", status); dev_dbg(dev->class_dev, "A/D FIFO empty (%4x)\n", status);
s->async->events |= COMEDI_CB_ERROR; s->async->events |= COMEDI_CB_ERROR;
comedi_handle_events(dev, s);
return; return;
} }
if (status & Status_FF) { if (status & Status_FF) {
dev_dbg(dev->class_dev, dev_dbg(dev->class_dev,
"A/D FIFO Full status (Fatal Error!) (%4x)\n", status); "A/D FIFO Full status (Fatal Error!) (%4x)\n", status);
s->async->events |= COMEDI_CB_ERROR; s->async->events |= COMEDI_CB_ERROR;
comedi_handle_events(dev, s);
return; return;
} }
...@@ -696,8 +694,6 @@ static void pci1710_handle_every_sample(struct comedi_device *dev, ...@@ -696,8 +694,6 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
} }
outb(0, dev->iobase + PCI171x_CLRINT); /* clear our INT request */ outb(0, dev->iobase + PCI171x_CLRINT); /* clear our INT request */
comedi_handle_events(dev, s);
} }
static int move_block_from_fifo(struct comedi_device *dev, static int move_block_from_fifo(struct comedi_device *dev,
...@@ -731,14 +727,12 @@ static void pci1710_handle_fifo(struct comedi_device *dev, ...@@ -731,14 +727,12 @@ static void pci1710_handle_fifo(struct comedi_device *dev,
if (!(m & Status_FH)) { if (!(m & Status_FH)) {
dev_dbg(dev->class_dev, "A/D FIFO not half full! (%4x)\n", m); dev_dbg(dev->class_dev, "A/D FIFO not half full! (%4x)\n", m);
s->async->events |= COMEDI_CB_ERROR; s->async->events |= COMEDI_CB_ERROR;
comedi_handle_events(dev, s);
return; return;
} }
if (m & Status_FF) { if (m & Status_FF) {
dev_dbg(dev->class_dev, dev_dbg(dev->class_dev,
"A/D FIFO Full status (Fatal Error!) (%4x)\n", m); "A/D FIFO Full status (Fatal Error!) (%4x)\n", m);
s->async->events |= COMEDI_CB_ERROR; s->async->events |= COMEDI_CB_ERROR;
comedi_handle_events(dev, s);
return; return;
} }
...@@ -758,12 +752,10 @@ static void pci1710_handle_fifo(struct comedi_device *dev, ...@@ -758,12 +752,10 @@ static void pci1710_handle_fifo(struct comedi_device *dev,
if (cmd->stop_src == TRIG_COUNT && if (cmd->stop_src == TRIG_COUNT &&
s->async->scans_done >= cmd->stop_arg) { s->async->scans_done >= cmd->stop_arg) {
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
comedi_handle_events(dev, s);
return; return;
} }
outb(0, dev->iobase + PCI171x_CLRINT); /* clear our INT request */ outb(0, dev->iobase + PCI171x_CLRINT); /* clear our INT request */
comedi_handle_events(dev, s);
} }
static irqreturn_t interrupt_service_pci1710(int irq, void *d) static irqreturn_t interrupt_service_pci1710(int irq, void *d)
...@@ -802,6 +794,8 @@ static irqreturn_t interrupt_service_pci1710(int irq, void *d) ...@@ -802,6 +794,8 @@ static irqreturn_t interrupt_service_pci1710(int irq, void *d)
else else
pci1710_handle_fifo(dev, s); pci1710_handle_fifo(dev, s);
comedi_handle_events(dev, s);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment