if (bc.subdevice >= dev->n_subdevices || bc.subdevice < 0)
return -EINVAL;
- s = dev->subdevices + bc.subdevice;
+ s = &dev->subdevices[bc.subdevice];
async = s->async;
if (!async) {
/* fill subdinfo structs */
for (i = 0; i < dev->n_subdevices; i++) {
- s = dev->subdevices + i;
+ s = &dev->subdevices[i];
us = tmp + i;
us->type = s->type;
if (it.subdev >= dev->n_subdevices)
return -EINVAL;
- s = dev->subdevices + it.subdev;
+ s = &dev->subdevices[it.subdev];
if (it.maxdata_list) {
if (s->maxdata || !s->maxdata_list)
if (bi.subdevice >= dev->n_subdevices || bi.subdevice < 0)
return -EINVAL;
- s = dev->subdevices + bi.subdevice;
+ s = &dev->subdevices[bi.subdevice];
if (s->lock && s->lock != file)
return -EACCES;
ret = -EINVAL;
break;
}
- s = dev->subdevices + insn->subdev;
+ s = &dev->subdevices[insn->subdev];
if (!s->async) {
DPRINTK("no async\n");
ret = -EINVAL;
ret = -EINVAL;
goto out;
}
- s = dev->subdevices + insn->subdev;
+ s = &dev->subdevices[insn->subdev];
if (s->type == COMEDI_SUBD_UNUSED) {
DPRINTK("%d not usable subdevice\n", insn->subdev);
return -ENODEV;
}
- s = dev->subdevices + user_cmd.subdev;
+ s = &dev->subdevices[user_cmd.subdev];
async = s->async;
if (s->type == COMEDI_SUBD_UNUSED) {
return -ENODEV;
}
- s = dev->subdevices + user_cmd.subdev;
+ s = &dev->subdevices[user_cmd.subdev];
if (s->type == COMEDI_SUBD_UNUSED) {
DPRINTK("%d not valid subdevice\n", user_cmd.subdev);
return -EIO;
if (arg >= dev->n_subdevices)
return -EINVAL;
- s = dev->subdevices + arg;
+ s = &dev->subdevices[arg];
spin_lock_irqsave(&s->spin_lock, flags);
if (s->busy || s->lock)
if (arg >= dev->n_subdevices)
return -EINVAL;
- s = dev->subdevices + arg;
+ s = &dev->subdevices[arg];
if (s->busy)
return -EBUSY;
if (arg >= dev->n_subdevices)
return -EINVAL;
- s = dev->subdevices + arg;
+ s = &dev->subdevices[arg];
if (s->async == NULL)
return -EINVAL;
if (arg >= dev->n_subdevices)
return -EINVAL;
- s = dev->subdevices + arg;
+ s = &dev->subdevices[arg];
if (s->lock && s->lock != file)
return -EACCES;
if (dev->subdevices) {
for (i = 0; i < dev->n_subdevices; i++) {
- s = dev->subdevices + i;
+ s = &dev->subdevices[i];
if (s->busy == file)
do_cancel(dev, s);
return 0;
for (i = 0; i < dev->n_subdevices; i++) {
- s = dev->subdevices + i;
+ s = &dev->subdevices[i];
if (s->busy)
return 1;
if (s->async && s->async->mmap_count)