From 1b81dbc29b9a1ac6cb5c58217c181b675e91220c Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 27 May 2014 10:30:41 -0700 Subject: [PATCH] staging: comedi: usbduxsigma: remove 'ao_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 --- drivers/staging/comedi/drivers/usbduxsigma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index 05fb52e..6394f8b 100644 --- a/drivers/staging/comedi/drivers/usbduxsigma.c +++ b/drivers/staging/comedi/drivers/usbduxsigma.c @@ -167,7 +167,6 @@ struct usbduxsigma_private { unsigned high_speed:1; unsigned ai_cmd_running:1; unsigned ao_cmd_running:1; - unsigned ao_continuous:1; unsigned pwm_cmd_running:1; /* number of samples to acquire */ @@ -360,6 +359,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb) struct comedi_device *dev = urb->context; struct usbduxsigma_private *devpriv = dev->private; struct comedi_subdevice *s = dev->write_subdev; + struct comedi_cmd *cmd = &s->async->cmd; uint8_t *datap; int len; int ret; @@ -403,7 +403,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb) /* timer zero, transfer from comedi */ devpriv->ao_counter = devpriv->ao_timer; - if (!devpriv->ao_continuous) { + if (cmd->stop_src == TRIG_COUNT) { /* not continuous, fixed number of samples */ devpriv->ao_sample_count--; if (devpriv->ao_sample_count < 0) { @@ -984,10 +984,8 @@ static int usbduxsigma_ao_cmdtest(struct comedi_device *dev, */ devpriv->ao_sample_count = cmd->stop_arg; } - devpriv->ao_continuous = 0; } else { /* continuous acquisition */ - devpriv->ao_continuous = 1; devpriv->ao_sample_count = 0; } -- 2.7.4