mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-24 05:01:03 +02:00
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 <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c0491d4eb4
commit
edf4537bcb
@@ -521,8 +521,6 @@ static bool pcl818_ai_next_chan(struct comedi_device *dev,
|
|||||||
struct pcl818_private *devpriv = dev->private;
|
struct pcl818_private *devpriv = dev->private;
|
||||||
struct comedi_cmd *cmd = &s->async->cmd;
|
struct comedi_cmd *cmd = &s->async->cmd;
|
||||||
|
|
||||||
s->async->events |= COMEDI_CB_BLOCK;
|
|
||||||
|
|
||||||
devpriv->act_chanlist_pos++;
|
devpriv->act_chanlist_pos++;
|
||||||
if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len)
|
if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len)
|
||||||
devpriv->act_chanlist_pos = 0;
|
devpriv->act_chanlist_pos = 0;
|
||||||
@@ -560,7 +558,7 @@ static void pcl818_handle_eoc(struct comedi_device *dev,
|
|||||||
if (pcl818_ai_dropout(dev, s, chan))
|
if (pcl818_ai_dropout(dev, s, chan))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
comedi_buf_put(s, val);
|
comedi_buf_write_samples(s, &val, 1);
|
||||||
|
|
||||||
pcl818_ai_next_chan(dev, s);
|
pcl818_ai_next_chan(dev, s);
|
||||||
}
|
}
|
||||||
@@ -589,7 +587,7 @@ static void pcl818_handle_dma(struct comedi_device *dev,
|
|||||||
if (pcl818_ai_dropout(dev, s, chan))
|
if (pcl818_ai_dropout(dev, s, chan))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
comedi_buf_put(s, val);
|
comedi_buf_write_samples(s, &val, 1);
|
||||||
|
|
||||||
if (!pcl818_ai_next_chan(dev, s))
|
if (!pcl818_ai_next_chan(dev, s))
|
||||||
break;
|
break;
|
||||||
@@ -630,7 +628,7 @@ static void pcl818_handle_fifo(struct comedi_device *dev,
|
|||||||
if (pcl818_ai_dropout(dev, s, chan))
|
if (pcl818_ai_dropout(dev, s, chan))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
comedi_buf_put(s, val);
|
comedi_buf_write_samples(s, &val, 1);
|
||||||
|
|
||||||
if (!pcl818_ai_next_chan(dev, s))
|
if (!pcl818_ai_next_chan(dev, s))
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user