Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd3a3cd6 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

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: 0953ee4a ("staging: comedi: ni_mio_common: checkpatch.pl cleanup (else not useful)")
Cc: <stable@vger.kernel.org> # 3.17+
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 98217767
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ static void ni_writel(struct comedi_device *dev, uint32_t data, int reg)
{
	if (dev->mmio)
		writel(data, dev->mmio + reg);

	else
		outl(data, dev->iobase + reg);
}

@@ -254,7 +254,7 @@ static void ni_writew(struct comedi_device *dev, uint16_t data, int reg)
{
	if (dev->mmio)
		writew(data, dev->mmio + reg);

	else
		outw(data, dev->iobase + reg);
}

@@ -262,7 +262,7 @@ static void ni_writeb(struct comedi_device *dev, uint8_t data, int reg)
{
	if (dev->mmio)
		writeb(data, dev->mmio + reg);

	else
		outb(data, dev->iobase + reg);
}