Commit 80ffd625 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: adl_pci9118: remove 'ai_scans' from private data

This member of the private data is just a copy of the cmd->stop_arg.
Use that instead.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b27a436
...@@ -348,7 +348,6 @@ struct pci9118_private { ...@@ -348,7 +348,6 @@ struct pci9118_private {
* on external start * on external start
*/ */
unsigned short ao_data[2]; /* data output buffer */ unsigned short ao_data[2]; /* data output buffer */
unsigned int ai_scans; /* number of scans to do */
char dma_doublebuf; /* we can use double buffering */ char dma_doublebuf; /* we can use double buffering */
unsigned int dma_actbuf; /* which buffer is used now */ unsigned int dma_actbuf; /* which buffer is used now */
unsigned short *dmabuf_virt[2]; /* unsigned short *dmabuf_virt[2]; /*
...@@ -976,7 +975,7 @@ static void interrupt_pci9118_ai_onesample(struct comedi_device *dev, ...@@ -976,7 +975,7 @@ static void interrupt_pci9118_ai_onesample(struct comedi_device *dev,
devpriv->ai_act_scan++; devpriv->ai_act_scan++;
if (!devpriv->ai_neverending) { if (!devpriv->ai_neverending) {
/* all data sampled? */ /* all data sampled? */
if (devpriv->ai_act_scan >= devpriv->ai_scans) if (devpriv->ai_act_scan >= cmd->stop_arg)
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
} }
} }
...@@ -991,6 +990,7 @@ static void interrupt_pci9118_ai_dma(struct comedi_device *dev, ...@@ -991,6 +990,7 @@ static void interrupt_pci9118_ai_dma(struct comedi_device *dev,
unsigned short int_daq) unsigned short int_daq)
{ {
struct pci9118_private *devpriv = dev->private; struct pci9118_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int next_dma_buf, samplesinbuf, sampls, m; unsigned int next_dma_buf, samplesinbuf, sampls, m;
if (int_amcc & MASTER_ABORT_INT) { if (int_amcc & MASTER_ABORT_INT) {
...@@ -1041,7 +1041,7 @@ static void interrupt_pci9118_ai_dma(struct comedi_device *dev, ...@@ -1041,7 +1041,7 @@ static void interrupt_pci9118_ai_dma(struct comedi_device *dev,
if (!devpriv->ai_neverending) { if (!devpriv->ai_neverending) {
/* all data sampled? */ /* all data sampled? */
if (devpriv->ai_act_scan >= devpriv->ai_scans) if (devpriv->ai_act_scan >= cmd->stop_arg)
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
} }
...@@ -1332,6 +1332,7 @@ static int Compute_and_setup_dma(struct comedi_device *dev, ...@@ -1332,6 +1332,7 @@ static int Compute_and_setup_dma(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct pci9118_private *devpriv = dev->private; struct pci9118_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int dmalen0, dmalen1, i; unsigned int dmalen0, dmalen1, i;
dmalen0 = devpriv->dmabuf_size[0]; dmalen0 = devpriv->dmabuf_size[0];
...@@ -1413,10 +1414,10 @@ static int Compute_and_setup_dma(struct comedi_device *dev, ...@@ -1413,10 +1414,10 @@ static int Compute_and_setup_dma(struct comedi_device *dev,
/* fits whole measure into one DMA buffer? */ /* fits whole measure into one DMA buffer? */
if (dmalen0 > if (dmalen0 >
((devpriv->ai_n_realscanlen << 1) * ((devpriv->ai_n_realscanlen << 1) *
devpriv->ai_scans)) { cmd->stop_arg)) {
dmalen0 = dmalen0 =
(devpriv->ai_n_realscanlen << 1) * (devpriv->ai_n_realscanlen << 1) *
devpriv->ai_scans; cmd->stop_arg;
dmalen0 &= ~3L; dmalen0 &= ~3L;
} else { /* } else { /*
* fits whole measure into * fits whole measure into
...@@ -1424,10 +1425,10 @@ static int Compute_and_setup_dma(struct comedi_device *dev, ...@@ -1424,10 +1425,10 @@ static int Compute_and_setup_dma(struct comedi_device *dev,
*/ */
if (dmalen1 > if (dmalen1 >
((devpriv->ai_n_realscanlen << 1) * ((devpriv->ai_n_realscanlen << 1) *
devpriv->ai_scans - dmalen0)) cmd->stop_arg - dmalen0))
dmalen1 = dmalen1 =
(devpriv->ai_n_realscanlen << 1) * (devpriv->ai_n_realscanlen << 1) *
devpriv->ai_scans - dmalen0; cmd->stop_arg - dmalen0;
dmalen1 &= ~3L; dmalen1 &= ~3L;
} }
} }
...@@ -1630,12 +1631,8 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -1630,12 +1631,8 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
#endif #endif
if (cmd->stop_src == TRIG_NONE) if (cmd->stop_src == TRIG_NONE)
devpriv->ai_neverending = 1; devpriv->ai_neverending = 1;
if (cmd->stop_src == TRIG_COUNT) { if (cmd->stop_src == TRIG_COUNT)
devpriv->ai_scans = cmd->stop_arg;
devpriv->ai_neverending = 0; devpriv->ai_neverending = 0;
} else {
devpriv->ai_scans = 0;
}
/* use sample&hold signal? */ /* use sample&hold signal? */
if (cmd->convert_src == TRIG_NOW) if (cmd->convert_src == TRIG_NOW)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment