From: H Hartley Sweeten Date: Wed, 22 Oct 2014 22:36:31 +0000 (-0700) Subject: staging: comedi: ni_labpc_isadma: use comedi_buf_write_samples() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b9357cba10f866799516befba2bb374463ccf74d;p=openwrt%2Fstaging%2Fblogic.git staging: comedi: ni_labpc_isadma: use comedi_buf_write_samples() Use comedi_buf_write_samples() instead of cfc_write_to_buffer() to add all the samples to the async buffer in one operation. 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_labpc_isadma.c b/drivers/staging/comedi/drivers/ni_labpc_isadma.c index 967202e0635e..6d386050e59d 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_isadma.c +++ b/drivers/staging/comedi/drivers/ni_labpc_isadma.c @@ -91,7 +91,6 @@ void labpc_drain_dma(struct comedi_device *dev) int status; unsigned long flags; unsigned int max_points, num_points, residue, leftover; - int i; status = devpriv->stat1; @@ -122,9 +121,7 @@ void labpc_drain_dma(struct comedi_device *dev) leftover = max_points; } - /* write data to comedi buffer */ - for (i = 0; i < num_points; i++) - cfc_write_to_buffer(s, devpriv->dma_buffer[i]); + comedi_buf_write_samples(s, devpriv->dma_buffer, num_points); if (cmd->stop_src == TRIG_COUNT) devpriv->count -= num_points; @@ -133,8 +130,6 @@ void labpc_drain_dma(struct comedi_device *dev) set_dma_addr(devpriv->dma_chan, devpriv->dma_addr); set_dma_count(devpriv->dma_chan, leftover * sample_size); release_dma_lock(flags); - - async->events |= COMEDI_CB_BLOCK; } EXPORT_SYMBOL_GPL(labpc_drain_dma);