]> Pileus Git - ~andy/linux/commitdiff
staging: comedi: pcmmio: tidy up switch_page()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 9 Dec 2013 22:30:38 +0000 (15:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2013 18:01:49 +0000 (10:01 -0800)
All the I/O ports are left unlocked in the driver so the 'pagelock'
in the private data is not necessary. The paranoia sanity checks
are also unnecessary, Remove them.

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>
drivers/staging/comedi/drivers/pcmmio.c

index 850b8f152a0bd1f18cc12de5c8f74a3c34f08984..a279920989166c5cda6ae58468049e20826bb398 100644 (file)
@@ -213,7 +213,6 @@ struct pcmmio_subdev_private {
 struct pcmmio_private {
        /* stuff for DIO */
        struct {
-               unsigned char pagelock; /* current page and lock */
                /* shadow of POLx registers */
                unsigned char pol[NUM_PAGED_REGS];
                /* shadow of ENABx registers */
@@ -318,16 +317,7 @@ static void switch_page(struct comedi_device *dev, int asic, int page)
 {
        struct pcmmio_private *devpriv = dev->private;
 
-       if (asic < 0 || asic >= 1)
-               return;         /* paranoia */
-       if (page < 0 || page >= NUM_PAGES)
-               return;         /* more paranoia */
-
-       devpriv->asics[asic].pagelock &= ~REG_PAGE_MASK;
-       devpriv->asics[asic].pagelock |= page << REG_PAGE_BITOFFSET;
-
-       /* now write out the shadow register */
-       outb(devpriv->asics[asic].pagelock,
+       outb(page << REG_PAGE_BITOFFSET,
             devpriv->asics[asic].iobase + REG_PAGELOCK);
 }