staging: comedi: addi_apci_3501: remove "magic" numbers in apci3501_interrupt()
Use register bit defines from addi_tcw.h to remove the "magic" numbers. 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:
parent
cd5d0ae481
commit
020e05e74d
1 changed files with 7 additions and 5 deletions
|
@ -262,11 +262,12 @@ static irqreturn_t apci3501_interrupt(int irq, void *d)
|
||||||
|
|
||||||
/* Disable Interrupt */
|
/* Disable Interrupt */
|
||||||
ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
|
ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
|
||||||
ctrl &= 0xfffff9fd;
|
ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG |
|
||||||
|
ADDI_TCW_CTRL_IRQ_ENA);
|
||||||
outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);
|
outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);
|
||||||
|
|
||||||
status = inl(devpriv->tcw + ADDI_TCW_IRQ_REG) & 0x1;
|
status = inl(devpriv->tcw + ADDI_TCW_IRQ_REG);
|
||||||
if (!status) {
|
if (!(status & ADDI_TCW_IRQ)) {
|
||||||
dev_err(dev->class_dev, "IRQ from unknown source\n");
|
dev_err(dev->class_dev, "IRQ from unknown source\n");
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
}
|
}
|
||||||
|
@ -274,8 +275,9 @@ static irqreturn_t apci3501_interrupt(int irq, void *d)
|
||||||
/* Enable Interrupt Send a signal to from kernel to user space */
|
/* Enable Interrupt Send a signal to from kernel to user space */
|
||||||
send_sig(SIGIO, devpriv->tsk_Current, 0);
|
send_sig(SIGIO, devpriv->tsk_Current, 0);
|
||||||
ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
|
ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
|
||||||
ctrl &= 0xfffff9fd;
|
ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG |
|
||||||
ctrl |= 1 << 1;
|
ADDI_TCW_CTRL_IRQ_ENA);
|
||||||
|
ctrl |= ADDI_TCW_CTRL_IRQ_ENA;
|
||||||
outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);
|
outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);
|
||||||
inl(devpriv->tcw + ADDI_TCW_STATUS_REG);
|
inl(devpriv->tcw + ADDI_TCW_STATUS_REG);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue