staging: comedi: quatech_daqp_cs: use cfc_handle_events()
Use the comedi_fc helper function to automatically call the subdevice (*cancel) function when needed and call comedi_event(). Update the Kconfig so that COMEDI_QUATECH_DAQP_CS selects COMEDI_FC. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a4ccee260c
commit
fb6aa25009
2 changed files with 2 additions and 4 deletions
|
|
@ -1185,6 +1185,7 @@ config COMEDI_NI_MIO_CS
|
|||
|
||||
config COMEDI_QUATECH_DAQP_CS
|
||||
tristate "Quatech DAQP PCMCIA data capture card support"
|
||||
select COMEDI_FC
|
||||
---help---
|
||||
Enable support for the Quatech DAQP PCMCIA data capture cards
|
||||
DAQP-208 and DAQP-308
|
||||
|
|
|
|||
|
|
@ -214,7 +214,6 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
|
|||
s->async->events |=
|
||||
COMEDI_CB_EOA | COMEDI_CB_OVERFLOW;
|
||||
dev_warn(dev->class_dev, "data lost\n");
|
||||
daqp_ai_cancel(dev, s);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -231,7 +230,6 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
|
|||
if (devpriv->count > 0) {
|
||||
devpriv->count--;
|
||||
if (devpriv->count == 0) {
|
||||
daqp_ai_cancel(dev, s);
|
||||
s->async->events |= COMEDI_CB_EOA;
|
||||
break;
|
||||
}
|
||||
|
|
@ -244,13 +242,12 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
|
|||
if (loop_limit <= 0) {
|
||||
dev_warn(dev->class_dev,
|
||||
"loop_limit reached in daqp_interrupt()\n");
|
||||
daqp_ai_cancel(dev, s);
|
||||
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
|
||||
}
|
||||
|
||||
s->async->events |= COMEDI_CB_BLOCK;
|
||||
|
||||
comedi_event(dev, s);
|
||||
cfc_handle_events(dev, s);
|
||||
}
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue