Commit 31bebc03 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: me4000: only set SDF_DIFF when supported

Some of the boards supported by this driver do not have differential analog
inputs. Only set the SDF_DIFF subdev_flag when the board supports it.
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 14aa4789
...@@ -1284,7 +1284,9 @@ static int me4000_auto_attach(struct comedi_device *dev, ...@@ -1284,7 +1284,9 @@ static int me4000_auto_attach(struct comedi_device *dev,
/* Analog Input subdevice */ /* Analog Input subdevice */
s = &dev->subdevices[0]; s = &dev->subdevices[0];
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF; s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND;
if (board->ai_diff_nchan)
s->subdev_flags |= SDF_DIFF;
s->n_chan = board->ai_nchan; s->n_chan = board->ai_nchan;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->len_chanlist = ME4000_AI_CHANNEL_LIST_COUNT; s->len_chanlist = ME4000_AI_CHANNEL_LIST_COUNT;
......
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