From: H Hartley Sweeten Date: Tue, 27 May 2014 17:30:39 +0000 (-0700) Subject: staging: comedi: usbduxfast: remove 'ai_continuous' from private data X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=61ff4709a5820bc28e76f184aa92f5a17ba88ea6;p=openwrt%2Fstaging%2Fblogic.git 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: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c index a4d7bfbcc6b9..376d14608926 100644 --- a/drivers/staging/comedi/drivers/usbduxfast.c +++ b/drivers/staging/comedi/drivers/usbduxfast.c @@ -154,7 +154,6 @@ struct usbduxfast_private { uint8_t *duxbuf; int8_t *inbuf; 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 */ int ignore; /* counter which ignores the first buffers */ @@ -239,6 +238,7 @@ static void usbduxfast_ai_interrupt(struct urb *urb) struct comedi_device *dev = urb->context; struct comedi_subdevice *s = dev->read_subdev; struct comedi_async *async = s->async; + struct comedi_cmd *cmd = &async->cmd; struct usb_device *usb = comedi_to_usb_dev(dev); struct usbduxfast_private *devpriv = dev->private; int n, err; @@ -285,7 +285,7 @@ static void usbduxfast_ai_interrupt(struct urb *urb) } if (!devpriv->ignore) { - if (!devpriv->ai_continous) { + if (cmd->stop_src == TRIG_COUNT) { /* not continuous, fixed number of samples */ n = urb->actual_length / sizeof(uint16_t); if (unlikely(devpriv->ai_sample_count < n)) { @@ -817,10 +817,8 @@ static int usbduxfast_ai_cmd(struct comedi_device *dev, up(&devpriv->sem); return -EFAULT; } - devpriv->ai_continous = 0; } else { /* continous acquisition */ - devpriv->ai_continous = 1; devpriv->ai_sample_count = 0; }