Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: comedi: ni_mio_common: fix the ni_write[blw]() functions

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)")
Cc: <stable@vger.kernel.org> # 3.17+
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>

authored by

H Hartley Sweeten and committed by
Greg Kroah-Hartman
bd3a3cd6 98217767

+6 -6
+6 -6
drivers/staging/comedi/drivers/ni_mio_common.c
··· 246 246 { 247 247 if (dev->mmio) 248 248 writel(data, dev->mmio + reg); 249 - 250 - outl(data, dev->iobase + reg); 249 + else 250 + outl(data, dev->iobase + reg); 251 251 } 252 252 253 253 static void ni_writew(struct comedi_device *dev, uint16_t data, int reg) 254 254 { 255 255 if (dev->mmio) 256 256 writew(data, dev->mmio + reg); 257 - 258 - outw(data, dev->iobase + reg); 257 + else 258 + outw(data, dev->iobase + reg); 259 259 } 260 260 261 261 static void ni_writeb(struct comedi_device *dev, uint8_t data, int reg) 262 262 { 263 263 if (dev->mmio) 264 264 writeb(data, dev->mmio + reg); 265 - 266 - outb(data, dev->iobase + reg); 265 + else 266 + outb(data, dev->iobase + reg); 267 267 } 268 268 269 269 static uint32_t ni_readl(struct comedi_device *dev, int reg)