]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: ni_mio_common: fix the ni_write[blw]() functions
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 22 Mar 2016 17:04:48 +0000 (10:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:08:49 +0000 (09:08 -0700)
commit bd3a3cd6c27b117fb9a43a38c8072c95332beecc upstream.

Memory mapped io (dev->mmio) should not also be writing to the ioport
(dev->iobase) registers. Add the missing 'else' to these functions.

Fixes: 0953ee4acca0 ("staging: comedi: ni_mio_common: checkpatch.pl cleanup (else not useful)")
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/ni_mio_common.c

index 6cc304a4c59bfca17a6055d99631424ebeafa09f..27fbf1a810975e86faa7819f06ff717ae842d957 100644 (file)
@@ -246,24 +246,24 @@ static void ni_writel(struct comedi_device *dev, uint32_t data, int reg)
 {
        if (dev->mmio)
                writel(data, dev->mmio + reg);
-
-       outl(data, dev->iobase + reg);
+       else
+               outl(data, dev->iobase + reg);
 }
 
 static void ni_writew(struct comedi_device *dev, uint16_t data, int reg)
 {
        if (dev->mmio)
                writew(data, dev->mmio + reg);
-
-       outw(data, dev->iobase + reg);
+       else
+               outw(data, dev->iobase + reg);
 }
 
 static void ni_writeb(struct comedi_device *dev, uint8_t data, int reg)
 {
        if (dev->mmio)
                writeb(data, dev->mmio + reg);
-
-       outb(data, dev->iobase + reg);
+       else
+               outb(data, dev->iobase + reg);
 }
 
 static uint32_t ni_readl(struct comedi_device *dev, int reg)