mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 12:33:18 -04:00
staging: comedi: pcl812: 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: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e5fc1a1925
commit
12f24996cc
@@ -1201,7 +1201,6 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||
break;
|
||||
}
|
||||
s->maxdata = board->ai_maxdata;
|
||||
s->len_chanlist = MAX_CHANLIST_LEN;
|
||||
s->range_table = board->rangelist_ai;
|
||||
if (board->board_type == boardACL8216)
|
||||
s->insn_read = acl8216_ai_insn_read;
|
||||
@@ -1209,13 +1208,14 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||
s->insn_read = pcl812_ai_insn_read;
|
||||
|
||||
devpriv->use_MPC = board->haveMPC508;
|
||||
s->cancel = pcl812_ai_cancel;
|
||||
if (dev->irq) {
|
||||
dev->read_subdev = s;
|
||||
s->subdev_flags |= SDF_CMD_READ;
|
||||
s->len_chanlist = MAX_CHANLIST_LEN;
|
||||
s->do_cmdtest = pcl812_ai_cmdtest;
|
||||
s->do_cmd = pcl812_ai_cmd;
|
||||
s->poll = pcl812_ai_poll;
|
||||
s->cancel = pcl812_ai_cancel;
|
||||
}
|
||||
switch (board->board_type) {
|
||||
case boardPCL812PG:
|
||||
|
||||
Reference in New Issue
Block a user