Skip to content

Commit c0491d4

Browse files
bigguinessgregkh
authored andcommitted
staging: comedi: pcl816: 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 76cb501 commit c0491d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/staging/comedi/drivers/pcl816.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,6 @@ static bool pcl816_ai_next_chan(struct comedi_device *dev,
289289
struct pcl816_private *devpriv = dev->private;
290290
struct comedi_cmd *cmd = &s->async->cmd;
291291

292-
s->async->events |= COMEDI_CB_BLOCK;
293-
294292
s->async->cur_chan++;
295293
if (s->async->cur_chan >= cmd->chanlist_len) {
296294
s->async->cur_chan = 0;
@@ -313,10 +311,12 @@ static void transfer_from_dma_buf(struct comedi_device *dev,
313311
unsigned short *ptr,
314312
unsigned int bufptr, unsigned int len)
315313
{
314+
unsigned short val;
316315
int i;
317316

318317
for (i = 0; i < len; i++) {
319-
comedi_buf_put(s, ptr[bufptr++]);
318+
val = ptr[bufptr++];
319+
comedi_buf_write_samples(s, &val, 1);
320320

321321
if (!pcl816_ai_next_chan(dev, s))
322322
return;

0 commit comments

Comments
 (0)