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

staging: comedi: amplc_pci224: remove 'ai_stop_continuous' from private data

This member of the private data can be determined by checking the cmd->stop_src.
Do 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 56e78120
...@@ -377,7 +377,6 @@ struct pci224_private { ...@@ -377,7 +377,6 @@ struct pci224_private {
unsigned int cached_div1; unsigned int cached_div1;
unsigned int cached_div2; unsigned int cached_div2;
unsigned int ao_stop_count; unsigned int ao_stop_count;
short ao_stop_continuous;
unsigned short ao_enab; /* max 16 channels so 'short' will do */ unsigned short ao_enab; /* max 16 channels so 'short' will do */
unsigned char intsce; unsigned char intsce;
}; };
...@@ -521,7 +520,7 @@ static void pci224_ao_start(struct comedi_device *dev, ...@@ -521,7 +520,7 @@ static void pci224_ao_start(struct comedi_device *dev,
unsigned long flags; unsigned long flags;
set_bit(AO_CMD_STARTED, &devpriv->state); set_bit(AO_CMD_STARTED, &devpriv->state);
if (!devpriv->ao_stop_continuous && devpriv->ao_stop_count == 0) { if (cmd->stop_src == TRIG_COUNT && devpriv->ao_stop_count == 0) {
/* An empty acquisition! */ /* An empty acquisition! */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
cfc_handle_events(dev, s); cfc_handle_events(dev, s);
...@@ -560,7 +559,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev, ...@@ -560,7 +559,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev,
} }
/* Determine number of scans available in buffer. */ /* Determine number of scans available in buffer. */
num_scans = comedi_buf_read_n_available(s->async) / bytes_per_scan; num_scans = comedi_buf_read_n_available(s->async) / bytes_per_scan;
if (!devpriv->ao_stop_continuous) { if (cmd->stop_src == TRIG_COUNT) {
/* Fixed number of scans. */ /* Fixed number of scans. */
if (num_scans > devpriv->ao_stop_count) if (num_scans > devpriv->ao_stop_count)
num_scans = devpriv->ao_stop_count; num_scans = devpriv->ao_stop_count;
...@@ -572,7 +571,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev, ...@@ -572,7 +571,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev,
switch (dacstat & PCI224_DACCON_FIFOFL_MASK) { switch (dacstat & PCI224_DACCON_FIFOFL_MASK) {
case PCI224_DACCON_FIFOFL_EMPTY: case PCI224_DACCON_FIFOFL_EMPTY:
room = PCI224_FIFO_ROOM_EMPTY; room = PCI224_FIFO_ROOM_EMPTY;
if (!devpriv->ao_stop_continuous && devpriv->ao_stop_count == 0) { if (cmd->stop_src == TRIG_COUNT && devpriv->ao_stop_count == 0) {
/* FIFO empty at end of counted acquisition. */ /* FIFO empty at end of counted acquisition. */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
cfc_handle_events(dev, s); cfc_handle_events(dev, s);
...@@ -614,7 +613,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev, ...@@ -614,7 +613,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev,
dev->iobase + PCI224_DACDATA); dev->iobase + PCI224_DACDATA);
} }
} }
if (!devpriv->ao_stop_continuous) { if (cmd->stop_src == TRIG_COUNT) {
devpriv->ao_stop_count -= num_scans; devpriv->ao_stop_count -= num_scans;
if (devpriv->ao_stop_count == 0) { if (devpriv->ao_stop_count == 0) {
/* /*
...@@ -952,18 +951,10 @@ static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -952,18 +951,10 @@ static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
/* /*
* Sort out end of acquisition. * Sort out end of acquisition.
*/ */
switch (cmd->stop_src) { if (cmd->stop_src == TRIG_COUNT)
case TRIG_COUNT:
/* Fixed number of scans. */
devpriv->ao_stop_continuous = 0;
devpriv->ao_stop_count = cmd->stop_arg; devpriv->ao_stop_count = cmd->stop_arg;
break; else /* TRIG_EXT | TRIG_NONE */
default:
/* Continuous scans. */
devpriv->ao_stop_continuous = 1;
devpriv->ao_stop_count = 0; devpriv->ao_stop_count = 0;
break;
}
spin_lock_irqsave(&devpriv->ao_spinlock, flags); spin_lock_irqsave(&devpriv->ao_spinlock, flags);
if (cmd->start_src == TRIG_INT) { if (cmd->start_src == TRIG_INT) {
......
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