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: 0953ee4acc
("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>
This commit is contained in:
parent
982177677a
commit
bd3a3cd6c2
|
@ -246,24 +246,24 @@ static void ni_writel(struct comedi_device *dev, uint32_t data, int reg)
|
||||||
{
|
{
|
||||||
if (dev->mmio)
|
if (dev->mmio)
|
||||||
writel(data, dev->mmio + reg);
|
writel(data, dev->mmio + reg);
|
||||||
|
else
|
||||||
outl(data, dev->iobase + reg);
|
outl(data, dev->iobase + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ni_writew(struct comedi_device *dev, uint16_t data, int reg)
|
static void ni_writew(struct comedi_device *dev, uint16_t data, int reg)
|
||||||
{
|
{
|
||||||
if (dev->mmio)
|
if (dev->mmio)
|
||||||
writew(data, dev->mmio + reg);
|
writew(data, dev->mmio + reg);
|
||||||
|
else
|
||||||
outw(data, dev->iobase + reg);
|
outw(data, dev->iobase + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ni_writeb(struct comedi_device *dev, uint8_t data, int reg)
|
static void ni_writeb(struct comedi_device *dev, uint8_t data, int reg)
|
||||||
{
|
{
|
||||||
if (dev->mmio)
|
if (dev->mmio)
|
||||||
writeb(data, dev->mmio + reg);
|
writeb(data, dev->mmio + reg);
|
||||||
|
else
|
||||||
outb(data, dev->iobase + reg);
|
outb(data, dev->iobase + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t ni_readl(struct comedi_device *dev, int reg)
|
static uint32_t ni_readl(struct comedi_device *dev, int reg)
|
||||||
|
|
Loading…
Reference in New Issue