staging: comedi: amplc_pci230: 'ao_scan_count' is always 'stop_arg'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Sep 2014 23:15:42 +0000 (16:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Sep 2014 21:35:20 +0000 (14:35 -0700)
When the cmd->stop_src == TRIG_COUNT, the 'ao_scan_count' is the cmd->stop_arg.
For any other stop_src the 'ao_scan_count' is 0, which is also the cmd->stop_arg.

Simplify the 'ao_scan_count' initialization.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/amplc_pci230.c

index 886186d00d4d344103c572c6adb38e424554df1e..a4d94f2605a3ee5a4d650d59bb38525f575047bc 100644 (file)
@@ -1354,11 +1354,7 @@ static int pci230_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
                        return -EBUSY;
        }
 
-       /* Get number of scans required. */
-       if (cmd->stop_src == TRIG_COUNT)
-               devpriv->ao_scan_count = cmd->stop_arg;
-       else    /* TRIG_NONE, user calls cancel */
-               devpriv->ao_scan_count = 0;
+       devpriv->ao_scan_count = cmd->stop_arg;
 
        /*
         * Set range - see analogue output range table; 0 => unipolar 10V,