From: H Hartley Sweeten Date: Tue, 9 Sep 2014 20:05:30 +0000 (-0700) Subject: staging: comedi: adl_pci9118: handle master/target abort in main interrupt handler X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=318141a18f7337338451512cc37ada3bf0a22ae6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: adl_pci9118: handle master/target abort in main interrupt handler For aesthetics, move the master/target abort detection from the DMA handler to the main interrupt handler. This allows removing the unused 'int_amcc' parameter from the DMA and non-DMA handlers. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 728df2503cc7..d32c84a810a8 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -727,7 +727,6 @@ 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 int int_amcc, unsigned short int_daq) { struct pci9118_private *devpriv = dev->private; @@ -773,26 +772,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 int int_amcc, unsigned short int_daq) { struct pci9118_private *devpriv = dev->private; struct comedi_cmd *cmd = &s->async->cmd; unsigned int next_dma_buf, samplesinbuf, sampls, m; - if (int_amcc & MASTER_ABORT_INT) { - dev_err(dev->class_dev, "AMCC IRQ - MASTER DMA ABORT!\n"); - s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA; - cfc_handle_events(dev, s); - return; - } - - if (int_amcc & TARGET_ABORT_INT) { - dev_err(dev->class_dev, "AMCC IRQ - TARGET DMA ABORT!\n"); - s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA; - cfc_handle_events(dev, s); - return; - } if (int_adstat & devpriv->ai_maskerr) /* if (int_adstat & 0x106) */ if (pci9118_decode_error_status(dev, s, int_adstat)) @@ -862,6 +847,20 @@ static irqreturn_t pci9118_interrupt(int irq, void *d) outl(intcsr | 0x00ff0000, devpriv->iobase_a + AMCC_OP_REG_INTCSR); + if (intcsr & MASTER_ABORT_INT) { + dev_err(dev->class_dev, "AMCC IRQ - MASTER DMA ABORT!\n"); + s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA; + cfc_handle_events(dev, s); + return IRQ_HANDLED; + } + + if (intcsr & TARGET_ABORT_INT) { + dev_err(dev->class_dev, "AMCC IRQ - TARGET DMA ABORT!\n"); + s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA; + cfc_handle_events(dev, s); + return IRQ_HANDLED; + } + adstat = inl(dev->iobase + PCI9118_AI_STATUS_REG) & 0x1ff; if (!devpriv->ai_do) @@ -893,9 +892,9 @@ static irqreturn_t pci9118_interrupt(int irq, void *d) } if (devpriv->usedma) - interrupt_pci9118_ai_dma(dev, s, adstat, intcsr, intsrc); + interrupt_pci9118_ai_dma(dev, s, adstat, intsrc); else - interrupt_pci9118_ai_onesample(dev, s, adstat, intcsr, intsrc); + interrupt_pci9118_ai_onesample(dev, s, adstat, intsrc); return IRQ_HANDLED; }