staging: comedi: addi_apci_3120: properly disable interrupts in apci3120_cancel()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Nov 2014 17:54:14 +0000 (10:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:33:59 +0000 (09:33 -0800)
The APCI3120_DISABLE_ALL_INTERRUPT define is a mask value used to clear bits
in devpriv->b_ModeSelectRegister to disable the interrupt sources. Writing this
value directly sets unintended bits.

Just set the devpriv->b_ModeSelectRegister to '0' and write that to the register.

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 2dd8e665d4719e3cc834f9445856f756f374b812..84aff802ae18e4a8a81ec5971642ed966f9acf11 100644 (file)
@@ -92,8 +92,6 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
 #define APCI3120_DISABLE_EOS_INT       (~APCI3120_ENABLE_EOS_INT)
 #define APCI3120_ENABLE_EOC_INT                0x1
 #define APCI3120_DISABLE_EOC_INT       (~APCI3120_ENABLE_EOC_INT)
-#define APCI3120_DISABLE_ALL_INTERRUPT                 \
-       (APCI3120_DISABLE_TIMER_INT & APCI3120_DISABLE_EOS_INT & APCI3120_DISABLE_EOC_INT)
 
 /* status register bits */
 #define APCI3120_EOC                   0x8000
@@ -424,8 +422,9 @@ static int apci3120_cancel(struct comedi_device *dev,
        outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG);
 
        /* DISABLE_ALL_INTERRUPT */
-       outb(APCI3120_DISABLE_ALL_INTERRUPT,
-               dev->iobase + APCI3120_WRITE_MODE_SELECT);
+       devpriv->b_ModeSelectRegister = 0;
+       outb(devpriv->b_ModeSelectRegister,
+            dev->iobase + APCI3120_WRITE_MODE_SELECT);
 
        apci3120_ai_reset_fifo(dev);
        inw(dev->iobase + APCI3120_RD_STATUS);
This page took 0.025756 seconds and 5 git commands to generate.