Commit 7689f55b authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: quatech_daqp_cs: only hook up cmd support if we have an IRQ

Interrupts are only needed by this driver to support the analog input async
commands. Don't hook up the command support if pcmcia_request_irq() fails
instead of completely failing the (*auto_attach).
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 16d6b587
...@@ -732,25 +732,28 @@ static int daqp_auto_attach(struct comedi_device *dev, ...@@ -732,25 +732,28 @@ static int daqp_auto_attach(struct comedi_device *dev,
link->priv = dev; link->priv = dev;
ret = pcmcia_request_irq(link, daqp_interrupt); ret = pcmcia_request_irq(link, daqp_interrupt);
if (ret) if (ret == 0)
return ret; dev->irq = link->irq;
ret = comedi_alloc_subdevices(dev, 4); ret = comedi_alloc_subdevices(dev, 4);
if (ret) if (ret)
return ret; return ret;
s = &dev->subdevices[0]; s = &dev->subdevices[0];
dev->read_subdev = s;
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF | SDF_CMD_READ; s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
s->n_chan = 8; s->n_chan = 8;
s->len_chanlist = 2048;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->range_table = &range_daqp_ai; s->range_table = &range_daqp_ai;
s->insn_read = daqp_ai_insn_read; s->insn_read = daqp_ai_insn_read;
s->do_cmdtest = daqp_ai_cmdtest; if (dev->irq) {
s->do_cmd = daqp_ai_cmd; dev->read_subdev = s;
s->cancel = daqp_ai_cancel; s->subdev_flags |= SDF_CMD_READ;
s->len_chanlist = 2048;
s->do_cmdtest = daqp_ai_cmdtest;
s->do_cmd = daqp_ai_cmd;
s->cancel = daqp_ai_cancel;
}
s = &dev->subdevices[1]; s = &dev->subdevices[1];
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
......
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