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

staging: comedi: s626: fix async command hookup

Only set the SDF_CMD_READ subdev_flag if the irq was sucessfully
requested.

Remove the unnecessary sanity check of dev->irq in s626_ai_cmd().
This callback is only hooked up if the irq is available.
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 4eb94628
...@@ -2079,12 +2079,6 @@ static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -2079,12 +2079,6 @@ static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
if (cmd == NULL) if (cmd == NULL)
return -EINVAL; return -EINVAL;
if (dev->irq == 0) {
comedi_error(dev,
"s626_ai_cmd: cannot run command without an irq");
return -EIO;
}
s626_ai_load_polllist(ppl, cmd); s626_ai_load_polllist(ppl, cmd);
devpriv->ai_cmd_running = 1; devpriv->ai_cmd_running = 1;
devpriv->ai_convert_count = 0; devpriv->ai_convert_count = 0;
...@@ -2833,7 +2827,7 @@ static int s626_auto_attach(struct comedi_device *dev, ...@@ -2833,7 +2827,7 @@ static int s626_auto_attach(struct comedi_device *dev,
s = &dev->subdevices[0]; s = &dev->subdevices[0];
/* analog input subdevice */ /* analog input subdevice */
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_CMD_READ; s->subdev_flags = SDF_READABLE | SDF_DIFF;
s->n_chan = S626_ADC_CHANNELS; s->n_chan = S626_ADC_CHANNELS;
s->maxdata = 0x3fff; s->maxdata = 0x3fff;
s->range_table = &s626_range_table; s->range_table = &s626_range_table;
...@@ -2841,6 +2835,7 @@ static int s626_auto_attach(struct comedi_device *dev, ...@@ -2841,6 +2835,7 @@ static int s626_auto_attach(struct comedi_device *dev,
s->insn_read = s626_ai_insn_read; s->insn_read = s626_ai_insn_read;
if (dev->irq) { if (dev->irq) {
dev->read_subdev = s; dev->read_subdev = s;
s->subdev_flags |= SDF_CMD_READ;
s->do_cmd = s626_ai_cmd; s->do_cmd = s626_ai_cmd;
s->do_cmdtest = s626_ai_cmdtest; s->do_cmdtest = s626_ai_cmdtest;
s->cancel = s626_ai_cancel; s->cancel = s626_ai_cancel;
......
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