summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten2014-09-09 22:05:31 +0200
committerGreg Kroah-Hartman2014-09-11 23:34:24 +0200
commitfed2c8406016f04b0d35b87c4aec77f4f0b7609b (patch)
treeef93762d26241c1929d92182caf89bec9693c359 /drivers/staging/comedi
parentstaging: comedi: adl_pci9118: handle master/target abort in main interrupt ha... (diff)
downloadkernel-qcow2-linux-fed2c8406016f04b0d35b87c4aec77f4f0b7609b.tar.gz
kernel-qcow2-linux-fed2c8406016f04b0d35b87c4aec77f4f0b7609b.tar.xz
kernel-qcow2-linux-fed2c8406016f04b0d35b87c4aec77f4f0b7609b.zip
staging: comedi: adl_pci9118: handle error detection in main interrupt handler
The DMA and non-DMA both check the analog input status value to detect hardware errors. For aesthetics, move the this detection into the main interrupt handler. This allows removing the unused 'int_adstat' parameter from the DMA and non-DMA handlers. In addition, the 'int_daq' parameter is also not used so remove it also. 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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/adl_pci9118.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c
index d32c84a810a8..c10d35adb7a9 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -725,18 +725,12 @@ static void pci9118_ai_munge(struct comedi_device *dev,
}
static void interrupt_pci9118_ai_onesample(struct comedi_device *dev,
- struct comedi_subdevice *s,
- unsigned short int_adstat,
- unsigned short int_daq)
+ struct comedi_subdevice *s)
{
struct pci9118_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned short sampl;
- if (int_adstat & devpriv->ai_maskerr)
- if (pci9118_decode_error_status(dev, s, int_adstat))
- return;
-
sampl = inl(dev->iobase + PCI9118_AI_FIFO_REG);
#ifdef PCI9118_PARANOIDCHECK
@@ -770,19 +764,12 @@ static void interrupt_pci9118_ai_onesample(struct comedi_device *dev,
}
static void interrupt_pci9118_ai_dma(struct comedi_device *dev,
- struct comedi_subdevice *s,
- unsigned short int_adstat,
- unsigned short int_daq)
+ struct comedi_subdevice *s)
{
struct pci9118_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int next_dma_buf, samplesinbuf, sampls, m;
- if (int_adstat & devpriv->ai_maskerr)
- /* if (int_adstat & 0x106) */
- if (pci9118_decode_error_status(dev, s, int_adstat))
- return;
-
samplesinbuf = devpriv->dmabuf_use_size[devpriv->dma_actbuf] >> 1;
/* number of received real samples */
@@ -862,6 +849,9 @@ static irqreturn_t pci9118_interrupt(int irq, void *d)
}
adstat = inl(dev->iobase + PCI9118_AI_STATUS_REG) & 0x1ff;
+ if (adstat & devpriv->ai_maskerr)
+ if (pci9118_decode_error_status(dev, s, adstat))
+ return IRQ_HANDLED;
if (!devpriv->ai_do)
return IRQ_HANDLED;
@@ -892,9 +882,9 @@ static irqreturn_t pci9118_interrupt(int irq, void *d)
}
if (devpriv->usedma)
- interrupt_pci9118_ai_dma(dev, s, adstat, intsrc);
+ interrupt_pci9118_ai_dma(dev, s);
else
- interrupt_pci9118_ai_onesample(dev, s, adstat, intsrc);
+ interrupt_pci9118_ai_onesample(dev, s);
return IRQ_HANDLED;
}