staging: comedi: me4000: fix me4000_ai_cancel()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 5 Aug 2015 17:45:10 +0000 (10:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 22:03:30 +0000 (15:03 -0700)
The STOP and IMMEDIATE_STOP bits in the ME4000_AI_CTRL_REG should be set,
not cleared, to stop any running conversions.

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/me4000.c

index b30305b44300dbf67efe5d8745730acbc03170b5..a171971b6a87628b7f055998da7422abe891be61 100644 (file)
@@ -529,12 +529,12 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
 static int me4000_ai_cancel(struct comedi_device *dev,
                            struct comedi_subdevice *s)
 {
-       unsigned int tmp;
+       unsigned int ctrl;
 
        /* Stop any running conversion */
-       tmp = inl(dev->iobase + ME4000_AI_CTRL_REG);
-       tmp &= ~(ME4000_AI_CTRL_STOP | ME4000_AI_CTRL_IMMEDIATE_STOP);
-       outl(tmp, dev->iobase + ME4000_AI_CTRL_REG);
+       ctrl = inl(dev->iobase + ME4000_AI_CTRL_REG);
+       ctrl |= ME4000_AI_CTRL_STOP | ME4000_AI_CTRL_IMMEDIATE_STOP;
+       outl(ctrl, dev->iobase + ME4000_AI_CTRL_REG);
 
        /* Clear the control register */
        outl(0x0, dev->iobase + ME4000_AI_CTRL_REG);