]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: addi_apci_3120: move start_src check into apci3120_cyclic_ai()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Nov 2014 17:54:50 +0000 (10:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:34:02 +0000 (09:34 -0800)
For aesthetics, move the check of the cmd->start_src.

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/addi-data/hwdrv_apci3120.c

index 1481d18a12fa0f3b258a1f0e1d5046a704e6ba15..b4d6fb467362c5516db07b9c207e0c7fea26179e 100644 (file)
@@ -404,8 +404,12 @@ static int apci3120_cyclic_ai(int mode,
                                                cmd->flags);
        }
 
-       if (devpriv->b_ExttrigEnable)
+       if (cmd->start_src == TRIG_EXT) {
+               devpriv->b_ExttrigEnable = 1;
                apci3120_exttrig_enable(dev, true);
+       } else {
+               devpriv->b_ExttrigEnable = 0;
+       }
 
        switch (mode) {
        case 1:
@@ -488,14 +492,8 @@ static int apci3120_cyclic_ai(int mode,
 static int apci3120_ai_cmd(struct comedi_device *dev,
                           struct comedi_subdevice *s)
 {
-       struct apci3120_private *devpriv = dev->private;
        struct comedi_cmd *cmd = &s->async->cmd;
 
-       if (cmd->start_src == TRIG_EXT)
-               devpriv->b_ExttrigEnable = 1;
-       else
-               devpriv->b_ExttrigEnable = 0;
-
        if (cmd->scan_begin_src == TRIG_FOLLOW)
                return apci3120_cyclic_ai(1, dev, s);
        /* TRIG_TIMER */