summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/pcl812.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-10-22 15:37:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-29 16:03:14 +0800
commit76cb501924258b222317d15ccd7df8feb057e593 (patch)
treeec7be2063bb699f87eea28f258de5ac3d749f9ee /drivers/staging/comedi/drivers/pcl812.c
parent778d695e67ac836130694942026d686995e2ddaa (diff)
staging: comedi: pcl812: 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 nnecessary event in the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/pcl812.c')
-rw-r--r--drivers/staging/comedi/drivers/pcl812.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/pcl812.c b/drivers/staging/comedi/drivers/pcl812.c
index 72ae48f4d256..eef646253bf9 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -844,8 +844,6 @@ static bool pcl812_ai_next_chan(struct comedi_device *dev,
struct pcl812_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
- s->async->events |= COMEDI_CB_BLOCK;
-
s->async->cur_chan++;
if (s->async->cur_chan >= cmd->chanlist_len) {
s->async->cur_chan = 0;
@@ -868,6 +866,7 @@ static void pcl812_handle_eoc(struct comedi_device *dev,
{
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int next_chan;
+ unsigned short val;
if (pcl812_ai_eoc(dev, s, NULL, 0)) {
dev_dbg(dev->class_dev, "A/D cmd IRQ without DRDY!\n");
@@ -875,7 +874,8 @@ static void pcl812_handle_eoc(struct comedi_device *dev,
return;
}
- comedi_buf_put(s, pcl812_ai_get_sample(dev, s));
+ val = pcl812_ai_get_sample(dev, s);
+ comedi_buf_write_samples(s, &val, 1);
/* Set up next channel. Added by abbotti 2010-01-20, but untested. */
next_chan = s->async->cur_chan + 1;
@@ -893,9 +893,11 @@ static void transfer_from_dma_buf(struct comedi_device *dev,
unsigned int bufptr, unsigned int len)
{
unsigned int i;
+ unsigned short val;
for (i = len; i; i--) {
- comedi_buf_put(s, ptr[bufptr++]);
+ val = ptr[bufptr++];
+ comedi_buf_write_samples(s, &val, 1);
if (!pcl812_ai_next_chan(dev, s))
break;