static irqreturn_t ni_65xx_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
- struct comedi_subdevice *s = dev->subdevices + 2;
+ struct comedi_subdevice *s = &dev->subdevices[2];
unsigned int status;
status = readb(private(dev)->mite->daq_io_addr + Change_Status);
if (ret)
return ret;
- s = dev->subdevices + 0;
+ s = &dev->subdevices[0];
if (board(dev)->num_di_ports) {
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE;
s->type = COMEDI_SUBD_UNUSED;
}
- s = dev->subdevices + 1;
+ s = &dev->subdevices[1];
if (board(dev)->num_do_ports) {
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->type = COMEDI_SUBD_UNUSED;
}
- s = dev->subdevices + 2;
+ s = &dev->subdevices[2];
if (board(dev)->num_dio_ports) {
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->type = COMEDI_SUBD_UNUSED;
}
- s = dev->subdevices + 3;
+ s = &dev->subdevices[3];
dev->read_subdev = s;
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE | SDF_CMD_READ;
if (dev->irq)
free_irq(dev->irq, dev);
if (private(dev)) {
+ struct comedi_subdevice *s;
unsigned i;
+
for (i = 0; i < dev->n_subdevices; ++i) {
- kfree(dev->subdevices[i].private);
- dev->subdevices[i].private = NULL;
+ s = &dev->subdevices[i];
+ kfree(s->private);
+ s->private = NULL;
}
if (private(dev)->mite)
mite_unsetup(private(dev)->mite);