Commit 5ac5c3bc authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: comedi: dt2811: fix a precedence bug

Bitwise | has higher precedence than ?: so we need to add some
parenthesis for this to work as intended.

Fixes: 7c957409 ('staging: comedi: dt2811: simplify A/D reference configuration')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c71f20ee
......@@ -588,8 +588,8 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s = &dev->subdevices[0];
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE |
(it->options[2] == 1) ? SDF_DIFF :
(it->options[2] == 2) ? SDF_COMMON : SDF_GROUND;
((it->options[2] == 1) ? SDF_DIFF :
(it->options[2] == 2) ? SDF_COMMON : SDF_GROUND);
s->n_chan = (it->options[2] == 1) ? 8 : 16;
s->maxdata = 0x0fff;
s->range_table = board->is_pgh ? &dt2811_pgh_ai_ranges
......
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