From: Ian Abbott Date: Mon, 3 Dec 2012 18:15:42 +0000 (+0000) Subject: staging: comedi: addi_apci_2032: set COMEDI_CB_OVERFLOW X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6bf9a3babe630a9972b28fd3bb7d2cfcd40e6409;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git staging: comedi: addi_apci_2032: set COMEDI_CB_OVERFLOW 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/addi_apci_2032.c b/drivers/staging/comedi/drivers/addi_apci_2032.c index f04f59d33cc7..aeb34dbe02a4 100644 --- a/drivers/staging/comedi/drivers/addi_apci_2032.c +++ b/drivers/staging/comedi/drivers/addi_apci_2032.c @@ -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;