Skip to content

Commit

Permalink
staging: comedi: addi_apci_2032: set COMEDI_CB_OVERFLOW
Browse files Browse the repository at this point in the history
If the call to `comedi_buf_put()` fails in the interrupt routine, set
the `COMEDI_CB_OVERFLOW` event flag.  Note that the `COMEDI_CB_ERROR`
flag will have also been set by `comedi_buf_put()` in this case.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent b82fe57 commit 6bf9a3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/staging/comedi/drivers/addi_apci_2032.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,10 @@ static irqreturn_t apci2032_interrupt(int irq, void *d)
s->state = inl(dev->iobase + APCI2032_INT_STATUS_REG);
outl(0x0, dev->iobase + APCI2032_INT_CTRL_REG);

comedi_buf_put(s->async, s->state);
s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
if (comedi_buf_put(s->async, s->state))
s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
else
s->async->events |= COMEDI_CB_OVERFLOW;
comedi_event(dev, s);

return IRQ_HANDLED;
Expand Down

0 comments on commit 6bf9a3b

Please sign in to comment.