]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: hwdrv_apci1564: tidy up apci1564_timer_insn_write()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 7 Aug 2015 18:45:09 +0000 (11:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Aug 2015 01:34:57 +0000 (18:34 -0700)
Clear the gate and trig bits in the common code path.

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_apci1564.c

index 3a02eaeee5c8bc8a29fe4db7f9f784c400002554..c4650db82f0e18a0fa1673c683c95f05bd9c90a5 100644 (file)
@@ -60,13 +60,12 @@ static int apci1564_timer_insn_write(struct comedi_device *dev,
        unsigned int ctrl;
 
        ctrl = inl(devpriv->timer + ADDI_TCW_CTRL_REG);
+       ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG);
        switch (data[1]) {
        case 0: /* Stop The Timer */
-               ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG |
-                         ADDI_TCW_CTRL_ENA);
+               ctrl &= ~ADDI_TCW_CTRL_ENA;
                break;
        case 1: /* Enable the Timer */
-               ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG);
                ctrl |= ADDI_TCW_CTRL_ENA;
                break;
        }