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

staging: comedi: pcl812: remove 'ai_neverending' from private data

This member of the private data is not needed. We can check the stop_src
to determine this information:

  ai_neverending -> cmd->stop_src == TRIG_NONE
  !ai_neverending -> cmd->stop_src == TRIG_COUNT
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 80cc6486
......@@ -529,7 +529,6 @@ struct pcl812_private {
unsigned int use_ext_trg:1;
unsigned int ai_dma:1;
unsigned int ai_eos:1;
unsigned int ai_neverending:1;
};
static void setup_range_channel(struct comedi_device *dev,
......@@ -768,11 +767,6 @@ static int pcl812_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
devpriv->ai_dma = 0;
devpriv->ai_data_len = s->async->prealloc_bufsz;
if (cmd->stop_src == TRIG_COUNT)
devpriv->ai_neverending = 0;
else
devpriv->ai_neverending = 1;
devpriv->ai_act_scan = 0;
devpriv->ai_poll_ptr = 0;
s->async->cur_chan = 0;
......@@ -803,7 +797,7 @@ static int pcl812_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
devpriv->dmabytestomove[1] =
devpriv->ai_data_len;
}
if (devpriv->ai_neverending) {
if (cmd->stop_src == TRIG_NONE) {
devpriv->dma_runs_to_end = 1;
} else {
/* how many samples we must transfer? */
......@@ -908,9 +902,9 @@ static irqreturn_t interrupt_pcl812_ai_int(int irq, void *d)
s->async->cur_chan = next_chan;
if (next_chan == 0) { /* one scan done */
devpriv->ai_act_scan++;
if (!(devpriv->ai_neverending))
if (cmd->stop_src == TRIG_COUNT &&
devpriv->ai_act_scan >= cmd->stop_arg) {
/* all data sampled */
if (devpriv->ai_act_scan >= cmd->stop_arg) {
s->cancel(dev, s);
s->async->events |= COMEDI_CB_EOA;
}
......@@ -938,9 +932,9 @@ static void transfer_from_dma_buf(struct comedi_device *dev,
if (s->async->cur_chan >= cmd->chanlist_len) {
s->async->cur_chan = 0;
devpriv->ai_act_scan++;
if (!devpriv->ai_neverending)
if (cmd->stop_src == TRIG_COUNT &&
devpriv->ai_act_scan >= cmd->stop_arg) {
/* all data sampled */
if (devpriv->ai_act_scan >= cmd->stop_arg) {
s->cancel(dev, s);
s->async->events |= COMEDI_CB_EOA;
break;
......
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