Commit 5d788d01 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: pcl818: only init async command members when needed

The 'len_chanlist' and 'cancel' members of the comedi_subdevice are
only used with async command support. Only initialize them if the irq
was sucessfully requested.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 281b6e75
...@@ -1279,15 +1279,15 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1279,15 +1279,15 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->subdev_flags |= SDF_DIFF; s->subdev_flags |= SDF_DIFF;
} }
s->maxdata = board->ai_maxdata; s->maxdata = board->ai_maxdata;
s->len_chanlist = s->n_chan;
s->range_table = board->ai_range_type; s->range_table = board->ai_range_type;
s->cancel = pcl818_ai_cancel;
s->insn_read = pcl818_ai_insn_read; s->insn_read = pcl818_ai_insn_read;
if (dev->irq) { if (dev->irq) {
dev->read_subdev = s; dev->read_subdev = s;
s->subdev_flags |= SDF_CMD_READ; s->subdev_flags |= SDF_CMD_READ;
s->len_chanlist = s->n_chan;
s->do_cmdtest = ai_cmdtest; s->do_cmdtest = ai_cmdtest;
s->do_cmd = ai_cmd; s->do_cmd = ai_cmd;
s->cancel = pcl818_ai_cancel;
} }
if (board->is_818) { if (board->is_818) {
if ((it->options[4] == 1) || (it->options[4] == 10)) if ((it->options[4] == 1) || (it->options[4] == 10))
......
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