Skip to content

Commit aa96f6e

Browse files
bigguinessgregkh
authored andcommitted
staging: comedi: dt3000: use comedi_buf_write_samples()
For aesthetics, use comedi_buf_write_samples() to add the sample to the async buffer. The core will set the COMEDi_CB_BLOCK event when data is written to the async buffer. Remove the unnecessary event from 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 1700529 commit aa96f6e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/staging/comedi/drivers/dt3000.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev,
315315

316316
for (i = 0; i < count; i++) {
317317
data = readw(dev->mmio + DPR_ADC_buffer + rear);
318-
comedi_buf_put(s, data);
318+
comedi_buf_write_samples(s, &data, 1);
319319
rear++;
320320
if (rear >= AI_FIFO_DEPTH)
321321
rear = 0;
@@ -351,10 +351,8 @@ static irqreturn_t dt3k_interrupt(int irq, void *d)
351351

352352
status = readw(dev->mmio + DPR_Intr_Flag);
353353

354-
if (status & DT3000_ADFULL) {
354+
if (status & DT3000_ADFULL)
355355
dt3k_ai_empty_fifo(dev, s);
356-
s->async->events |= COMEDI_CB_BLOCK;
357-
}
358356

359357
if (status & (DT3000_ADSWERR | DT3000_ADHWERR))
360358
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;

0 commit comments

Comments
 (0)