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

staging: comedi: usbduxfast: remove 'ai_continuous' from private data

This member of the private data can be determined from 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 c8f3174a
...@@ -154,7 +154,6 @@ struct usbduxfast_private { ...@@ -154,7 +154,6 @@ struct usbduxfast_private {
uint8_t *duxbuf; uint8_t *duxbuf;
int8_t *inbuf; int8_t *inbuf;
short int ai_cmd_running; /* asynchronous command is running */ short int ai_cmd_running; /* asynchronous command is running */
short int ai_continous; /* continous acquisition */
long int ai_sample_count; /* number of samples to acquire */ long int ai_sample_count; /* number of samples to acquire */
int ignore; /* counter which ignores the first int ignore; /* counter which ignores the first
buffers */ buffers */
...@@ -239,6 +238,7 @@ static void usbduxfast_ai_interrupt(struct urb *urb) ...@@ -239,6 +238,7 @@ static void usbduxfast_ai_interrupt(struct urb *urb)
struct comedi_device *dev = urb->context; struct comedi_device *dev = urb->context;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
struct comedi_async *async = s->async; struct comedi_async *async = s->async;
struct comedi_cmd *cmd = &async->cmd;
struct usb_device *usb = comedi_to_usb_dev(dev); struct usb_device *usb = comedi_to_usb_dev(dev);
struct usbduxfast_private *devpriv = dev->private; struct usbduxfast_private *devpriv = dev->private;
int n, err; int n, err;
...@@ -285,7 +285,7 @@ static void usbduxfast_ai_interrupt(struct urb *urb) ...@@ -285,7 +285,7 @@ static void usbduxfast_ai_interrupt(struct urb *urb)
} }
if (!devpriv->ignore) { if (!devpriv->ignore) {
if (!devpriv->ai_continous) { if (cmd->stop_src == TRIG_COUNT) {
/* not continuous, fixed number of samples */ /* not continuous, fixed number of samples */
n = urb->actual_length / sizeof(uint16_t); n = urb->actual_length / sizeof(uint16_t);
if (unlikely(devpriv->ai_sample_count < n)) { if (unlikely(devpriv->ai_sample_count < n)) {
...@@ -817,10 +817,8 @@ static int usbduxfast_ai_cmd(struct comedi_device *dev, ...@@ -817,10 +817,8 @@ static int usbduxfast_ai_cmd(struct comedi_device *dev,
up(&devpriv->sem); up(&devpriv->sem);
return -EFAULT; return -EFAULT;
} }
devpriv->ai_continous = 0;
} else { } else {
/* continous acquisition */ /* continous acquisition */
devpriv->ai_continous = 1;
devpriv->ai_sample_count = 0; devpriv->ai_sample_count = 0;
} }
......
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