staging: comedi: hwdrv_apci1564: tidy up apci1564_counter_insn_write()
[deliverable/linux.git] / drivers / staging / comedi / drivers / addi-data / hwdrv_apci1564.c
index dc738b26c60a7824221fe3ec3a31b1bfbd9c1070..1315554fb0962d635f01169acba230dd07f5c239 100644 (file)
@@ -147,16 +147,15 @@ static int apci1564_counter_insn_write(struct comedi_device *dev,
        unsigned int ctrl;
 
        ctrl = inl(iobase + ADDI_TCW_CTRL_REG);
+       ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG);
        switch (data[1]) {
        case 0: /* Stops the Counter subdevice */
                ctrl = 0;
                break;
        case 1: /* Start the Counter subdevice */
-               ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG);
                ctrl |= ADDI_TCW_CTRL_ENA;
                break;
        case 2: /* Clears the Counter subdevice */
-               ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG);
                ctrl |= ADDI_TCW_CTRL_GATE;
                break;
        }
This page took 0.027709 seconds and 5 git commands to generate.