Commit 07d93d1a authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: adv_pci1710: 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 aaf483b1
...@@ -314,7 +314,6 @@ struct pci1710_private { ...@@ -314,7 +314,6 @@ struct pci1710_private {
unsigned char act_chanlist_len; /* len of scanlist */ unsigned char act_chanlist_len; /* len of scanlist */
unsigned char act_chanlist_pos; /* actual position in MUX list */ unsigned char act_chanlist_pos; /* actual position in MUX list */
unsigned char da_ranges; /* copy of D/A outpit range register */ unsigned char da_ranges; /* copy of D/A outpit range register */
unsigned int ai_scans; /* len of scanlist */
unsigned int ai_data_len; /* len of data buffer */ unsigned int ai_data_len; /* len of data buffer */
unsigned short ao_data[4]; /* data output buffer */ unsigned short ao_data[4]; /* data output buffer */
unsigned int cnt0_write_wait; /* after a write, wait for update of the unsigned int cnt0_write_wait; /* after a write, wait for update of the
...@@ -801,7 +800,7 @@ static void interrupt_pci1710_every_sample(void *d) ...@@ -801,7 +800,7 @@ static void interrupt_pci1710_every_sample(void *d)
if (s->async->cur_chan == 0) { /* one scan done */ if (s->async->cur_chan == 0) { /* one scan done */
devpriv->ai_act_scan++; devpriv->ai_act_scan++;
if ((!devpriv->neverending_ai) && if ((!devpriv->neverending_ai) &&
(devpriv->ai_act_scan >= devpriv->ai_scans)) { (devpriv->ai_act_scan >= cmd->stop_arg)) {
/* all data sampled */ /* all data sampled */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
cfc_handle_events(dev, s); cfc_handle_events(dev, s);
...@@ -870,6 +869,7 @@ static void interrupt_pci1710_half_fifo(void *d) ...@@ -870,6 +869,7 @@ static void interrupt_pci1710_half_fifo(void *d)
const struct boardtype *this_board = comedi_board(dev); const struct boardtype *this_board = comedi_board(dev);
struct pci1710_private *devpriv = dev->private; struct pci1710_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
struct comedi_cmd *cmd = &s->async->cmd;
int m, samplesinbuf; int m, samplesinbuf;
m = inw(dev->iobase + PCI171x_STATUS); m = inw(dev->iobase + PCI171x_STATUS);
...@@ -901,8 +901,8 @@ static void interrupt_pci1710_half_fifo(void *d) ...@@ -901,8 +901,8 @@ static void interrupt_pci1710_half_fifo(void *d)
} }
if (!devpriv->neverending_ai) if (!devpriv->neverending_ai)
if (devpriv->ai_act_scan >= devpriv->ai_scans) { /* all data if (devpriv->ai_act_scan >= cmd->stop_arg) {
sampled */ /* all data sampled */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
cfc_handle_events(dev, s); cfc_handle_events(dev, s);
return; return;
...@@ -985,7 +985,7 @@ static int pci171x_ai_docmd_and_mode(int mode, struct comedi_device *dev, ...@@ -985,7 +985,7 @@ static int pci171x_ai_docmd_and_mode(int mode, struct comedi_device *dev,
devpriv->ai_eos = 0; devpriv->ai_eos = 0;
} }
if ((devpriv->ai_scans == 0) || (devpriv->ai_scans == -1)) if (cmd->stop_arg == 0)
devpriv->neverending_ai = 1; devpriv->neverending_ai = 1;
/* well, user want neverending */ /* well, user want neverending */
else else
...@@ -1119,12 +1119,6 @@ static int pci171x_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -1119,12 +1119,6 @@ static int pci171x_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
devpriv->ai_data_len = s->async->prealloc_bufsz; devpriv->ai_data_len = s->async->prealloc_bufsz;
if (cmd->stop_src == TRIG_COUNT)
devpriv->ai_scans = cmd->stop_arg;
else
devpriv->ai_scans = 0;
if (cmd->scan_begin_src == TRIG_FOLLOW) { /* mode 1, 2, 3 */ if (cmd->scan_begin_src == TRIG_FOLLOW) { /* mode 1, 2, 3 */
if (cmd->convert_src == TRIG_TIMER) { /* mode 1 and 2 */ if (cmd->convert_src == TRIG_TIMER) { /* mode 1 and 2 */
return pci171x_ai_docmd_and_mode(cmd->start_src == return pci171x_ai_docmd_and_mode(cmd->start_src ==
......
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