Commit 10933a9c authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: pcl818: exit interrupt quick when there is nothing to do

If an async ai command is not running or the ai_mode is 0 the interrupt
routine doesn't do anything other than spew some noise and clear the
interrupt request in the hardware.

Because this driver is manually attached, the "premature interrupt"
check in the interrupt handler should never happen. The interrupt is
only hooked up during the attach and it's released during the detach.

Combine these checks so that the interrupt function exits quick if it
has nothing to handle. Remove the noise.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d7a9f769
...@@ -732,8 +732,9 @@ static irqreturn_t interrupt_pcl818(int irq, void *d) ...@@ -732,8 +732,9 @@ static irqreturn_t interrupt_pcl818(int irq, void *d)
struct pcl818_private *devpriv = dev->private; struct pcl818_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
if (!dev->attached) { if (!dev->attached || !devpriv->ai_cmd_running ||
comedi_error(dev, "premature interrupt"); !devpriv->ai_mode) {
outb(0, dev->iobase + PCL818_CLRINT);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -764,15 +765,8 @@ static irqreturn_t interrupt_pcl818(int irq, void *d) ...@@ -764,15 +765,8 @@ static irqreturn_t interrupt_pcl818(int irq, void *d)
break; break;
} }
outb(0, dev->iobase + PCL818_CLRINT); /* clear INT request */ outb(0, dev->iobase + PCL818_CLRINT);
return IRQ_HANDLED;
if (!devpriv->ai_cmd_running || !devpriv->ai_mode) {
comedi_error(dev, "bad IRQ!");
return IRQ_NONE;
}
comedi_error(dev, "IRQ from unknown source!");
return IRQ_NONE;
} }
static void pcl818_ai_mode13dma_int(int mode, struct comedi_device *dev, static void pcl818_ai_mode13dma_int(int mode, struct comedi_device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment