Skip to content

Commit 1f44c03

Browse files
bigguinessgregkh
authored andcommitted
staging: comedi: pcl711: use comedi_buf_write_samples()
Use comedi_buf_write_samples() to add the sample to the async buffer. The async events will set properly by the core. Remove the unnecessary events in the driver. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 67fdc30 commit 1f44c03

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/staging/comedi/drivers/pcl711.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,12 @@ static irqreturn_t pcl711_interrupt(int irq, void *d)
213213

214214
outb(PCL711_INT_STAT_CLR, dev->iobase + PCL711_INT_STAT_REG);
215215

216-
if (comedi_buf_put(s, data) == 0) {
217-
s->async->events |= COMEDI_CB_OVERFLOW | COMEDI_CB_ERROR;
218-
} else {
219-
s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
216+
if (comedi_buf_write_samples(s, &data, 1)) {
220217
if (cmd->stop_src == TRIG_COUNT && !(--devpriv->ntrig))
221218
s->async->events |= COMEDI_CB_EOA;
222219
}
223220
comedi_handle_events(dev, s);
221+
224222
return IRQ_HANDLED;
225223
}
226224

0 commit comments

Comments
 (0)