From: H Hartley Sweeten Date: Tue, 4 Nov 2014 17:54:14 +0000 (-0700) Subject: staging: comedi: addi_apci_3120: properly disable interrupts in apci3120_cancel() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=b2cf40a31df207dacc298bc6c559b24e28a896e2;p=deliverable%2Flinux.git 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index 2dd8e665d471..84aff802ae18 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c @@ -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);