aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/pcmmio.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-12-09 15:31:03 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-17 10:02:13 -0800
commit29947fd6310292ce81d1ea4e0b56978a4a921b19 (patch)
treebc5f19296055db3cd4346f49199ddd6f52bf796f /drivers/staging/comedi/drivers/pcmmio.c
parentstaging: comedi: pcmmio: remove 'iobases' from the subdevice private data (diff)
downloadlinux-dev-29947fd6310292ce81d1ea4e0b56978a4a921b19.tar.xz
linux-dev-29947fd6310292ce81d1ea4e0b56978a4a921b19.zip
staging: comedi: pcmmio: simplify pcmmio_stop_intr()
This function is only called by the interrupt subdevice so the sanity check of the 'asic' is not necessary. Remove it. The 'nports' is always 3 and the 'firstport' is always 0. Remove the for () loop that clears the registers to disable the interrupts and just use the pcmmio_dio_write() helper to write to the three page registers. This also fixes a bug where the write to the page registers is not protected with the spinlock. 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/drivers/pcmmio.c')
-rw-r--r--drivers/staging/comedi/drivers/pcmmio.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c
index 7e1117fe4360..4da5e5864047 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -387,22 +387,13 @@ static void pcmmio_stop_intr(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct pcmmio_subdev_private *subpriv = s->private;
- int nports, firstport, asic, port;
-
- asic = subpriv->dio.intr.asic;
- if (asic < 0)
- return; /* not an interrupt subdev */
subpriv->dio.intr.enabled_mask = 0;
subpriv->dio.intr.active = 0;
s->async->inttrig = NULL;
- nports = subpriv->dio.intr.num_asic_chans / CHANS_PER_PORT;
- firstport = subpriv->dio.intr.asic_chan / CHANS_PER_PORT;
- switch_page(dev, PCMMIO_PAGE_ENAB);
- for (port = firstport; port < firstport + nports; ++port) {
- /* disable all intrs for this subdev.. */
- outb(0, dev->iobase + PCMMIO_PAGE_REG(port));
- }
+
+ /* disable all dio interrupts */
+ pcmmio_dio_write(dev, 0, PCMMIO_PAGE_ENAB, 0);
}
static irqreturn_t interrupt_pcmmio(int irq, void *d)