Skip to content

Commit edf4537

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

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/staging/comedi/drivers/pcl818.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,6 @@ static bool pcl818_ai_next_chan(struct comedi_device *dev,
521521
struct pcl818_private *devpriv = dev->private;
522522
struct comedi_cmd *cmd = &s->async->cmd;
523523

524-
s->async->events |= COMEDI_CB_BLOCK;
525-
526524
devpriv->act_chanlist_pos++;
527525
if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len)
528526
devpriv->act_chanlist_pos = 0;
@@ -560,7 +558,7 @@ static void pcl818_handle_eoc(struct comedi_device *dev,
560558
if (pcl818_ai_dropout(dev, s, chan))
561559
return;
562560

563-
comedi_buf_put(s, val);
561+
comedi_buf_write_samples(s, &val, 1);
564562

565563
pcl818_ai_next_chan(dev, s);
566564
}
@@ -589,7 +587,7 @@ static void pcl818_handle_dma(struct comedi_device *dev,
589587
if (pcl818_ai_dropout(dev, s, chan))
590588
break;
591589

592-
comedi_buf_put(s, val);
590+
comedi_buf_write_samples(s, &val, 1);
593591

594592
if (!pcl818_ai_next_chan(dev, s))
595593
break;
@@ -630,7 +628,7 @@ static void pcl818_handle_fifo(struct comedi_device *dev,
630628
if (pcl818_ai_dropout(dev, s, chan))
631629
break;
632630

633-
comedi_buf_put(s, val);
631+
comedi_buf_write_samples(s, &val, 1);
634632

635633
if (!pcl818_ai_next_chan(dev, s))
636634
break;

0 commit comments

Comments
 (0)