for(i = 0; i < COMEDI_NDEVICES; i++){
char name[20];
- class_device_destroy(comedi_class, comedi_devices[i].class_dev->devt);
+ class_device_destroy(comedi_class, MKDEV(COMEDI_MAJOR, i));
sprintf(name, "comedi%d", i);
}
class_destroy(comedi_class);
s = dev->subdevices + i;
if(s->class_dev)
{
- class_device_destroy(comedi_class, s->class_dev->devt);
+ unsigned minor = comedi_construct_minor_for_subdevice(dev, i);
+ dev_t devt = MKDEV(COMEDI_MAJOR, minor);
+ class_device_destroy(comedi_class, devt);
}
if(s->async)
{