staging: comedi: adv_pci1710: transfer all ai samples in one step
The two step process to transfer the ai samples in pci1710_handle_fifo() doesn't make any sense. If the async buffer does not have enough room for the samples the core will set the async event COMEDI_CB_OVERFLOW which will cause the async command to cancel. Splitting the transfer doesn't add any value. Transfer all the samples in one step to simplify the code. 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:
parent
f01663ec35
commit
d6c42d78c0
1 changed files with 2 additions and 13 deletions
|
@ -720,7 +720,6 @@ static void pci1710_handle_fifo(struct comedi_device *dev,
|
||||||
{
|
{
|
||||||
struct pci1710_private *devpriv = dev->private;
|
struct pci1710_private *devpriv = dev->private;
|
||||||
struct comedi_cmd *cmd = &s->async->cmd;
|
struct comedi_cmd *cmd = &s->async->cmd;
|
||||||
unsigned int nsamples;
|
|
||||||
unsigned int m;
|
unsigned int m;
|
||||||
|
|
||||||
m = inw(dev->iobase + PCI171x_STATUS);
|
m = inw(dev->iobase + PCI171x_STATUS);
|
||||||
|
@ -736,18 +735,8 @@ static void pci1710_handle_fifo(struct comedi_device *dev,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsamples = devpriv->max_samples;
|
if (move_block_from_fifo(dev, s, devpriv->max_samples))
|
||||||
if (comedi_samples_to_bytes(s, nsamples) >= s->async->prealloc_bufsz) {
|
|
||||||
m = comedi_bytes_to_samples(s, s->async->prealloc_bufsz);
|
|
||||||
if (move_block_from_fifo(dev, s, m))
|
|
||||||
return;
|
return;
|
||||||
nsamples -= m;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nsamples) {
|
|
||||||
if (move_block_from_fifo(dev, s, nsamples))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd->stop_src == TRIG_COUNT &&
|
if (cmd->stop_src == TRIG_COUNT &&
|
||||||
s->async->scans_done >= cmd->stop_arg) {
|
s->async->scans_done >= cmd->stop_arg) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue