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: 7c9574090d ('staging: comedi: dt2811: simplify A/D reference configuration')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dan Carpenter 2016-06-21 14:46:21 +03:00 committed by Greg Kroah-Hartman
parent c71f20ee76
commit 5ac5c3bcf5
1 changed files with 2 additions and 2 deletions

View File

@ -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