staging: comedi: addi_apci_3120: properly disable interrupts in apci3120_cancel()

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>
This commit is contained in:
H Hartley Sweeten
2014-11-04 10:54:14 -07:00
committed by Greg Kroah-Hartman
parent f85c54dbe5
commit b2cf40a31d

View 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);