insn function matching insn.n. Comedi documentation for userspace
comedi_do_insn allows a lower value to be returned and some drivers
blatently do so, particularly for configuration instructions.
Also added some XXX reminder comments for INSN_WAIT and INSN_CONFIG for
things that need to be fixed.
break;
}
case INSN_WAIT:
+ /* XXX isn't the value supposed to be nanosecs? */
if (insn->n < 1 || insn->data[0] >= 100) {
ret = -EINVAL;
break;
ret = s->insn_bits(dev, s, insn, insn->data);
break;
case INSN_CONFIG:
+ /* XXX should check instruction length */
ret = s->insn_config(dev, s, insn, insn->data);
break;
default:
}
if (ret < 0)
goto error;
+#if 0
+ /* XXX do we want this? -- abbotti #if'ed it out for now. */
if (ret != insn->n) {
rt_printk("BUG: result of insn != insn.n\n");
ret = -EINVAL;
goto error;
}
+#endif
error:
return ret;