From 9ca6df24f466ad964ba0b3494bf56250389a0ebd Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 17 Nov 2006 14:03:42 +0000 Subject: [PATCH] Don't assume class_device has a devt member. --- comedi/comedi_fops.c | 2 +- comedi/drivers.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 8385d09f..6c9a3009 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -1802,7 +1802,7 @@ static void __exit comedi_cleanup(void) 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); diff --git a/comedi/drivers.c b/comedi/drivers.c index f42a4036..683fd0da 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -73,7 +73,9 @@ static void cleanup_device_allocations(comedi_device *dev) 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) { -- 2.26.2