For INSN_WAIT, make sure insn->n is exactly 1.
For subdevice instructions, if subdevice is unused, return -EIO.
For subdevice instructions, if chanspec is wrong, return -EINVAL.
}
case INSN_WAIT:
/* XXX isn't the value supposed to be nanosecs? */
- if (insn->n < 1 || insn->data[0] >= 100) {
+ if (insn->n != 1 || insn->data[0] >= 100) {
ret = -EINVAL;
break;
}
if (s->type == COMEDI_SUBD_UNUSED) {
rt_printk("%d not useable subdevice\n", insn->subdev);
- /* XXX no return value is set! ret = ? */
+ ret = -EIO;
goto error;
}
if ((ret = check_chanlist(s, 1, &insn->chanspec)) < 0) {
rt_printk("bad chanspec\n");
- /* XXX no return value is set! ret = ? */
+ ret = -EINVAL;
goto error;
}