Commit 94254d1b authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: comedi: amplc_pci230: fix a precedence bug

The addition operation has higher precedence than ?: so this would write
to PCI230_DACOUT1 instead of devpriv->daqio + PCI230_DACOUT1.

Fixes: 4f9c63fe ('staging: comedi: amplc_pci230: refactor iobase addresses')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8075bfb6
......@@ -624,7 +624,7 @@ static inline void pci230_ao_write_nofifo(struct comedi_device *dev,
/* Write mangled datum to appropriate DACOUT register. */
outw(pci230_ao_mangle_datum(dev, datum),
devpriv->daqio + ((chan) == 0) ? PCI230_DACOUT1 : PCI230_DACOUT2);
devpriv->daqio + ((chan == 0) ? PCI230_DACOUT1 : PCI230_DACOUT2));
}
static inline void pci230_ao_write_fifo(struct comedi_device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment