diff -Naur cpint-2.5.3.orig/cpint.c cpint-2.5.3/cpint.c --- cpint-2.5.3.orig/cpint.c 2006-03-01 14:00:11.465720352 +0100 +++ cpint-2.5.3/cpint.c 2006-03-01 14:03:50.909359848 +0100 @@ -131,7 +131,7 @@ CPInt_Dev *cpint_devices; -static struct class_simple *cpint_class; +static struct class *cpint_class; /*----------------------------------------------------------*/ /* The different file operations */ @@ -309,7 +309,7 @@ /*------------------------------------------------------*/ /* Register this device class */ /*------------------------------------------------------*/ - cpint_class = class_simple_create(THIS_MODULE, "cpint"); + cpint_class = class_create(THIS_MODULE, "cpint"); if (IS_ERR(cpint_class)) { printk(KERN_ERR "Error creating cpint class.\n"); kfree(cpint_devices); @@ -320,19 +320,21 @@ /*------------------------------------------------------*/ /* Register the individual devices */ /*------------------------------------------------------*/ + memset(cpint_devices, 0, cpint_nr_devs * sizeof (CPInt_Dev)); for (i_dev = 0; i_dev < CPINT_NR_DEVS; i_dev++) { int fopIdx; fopIdx = fopMap[i_dev]; if (fopIdx > -1 && !(cpint_devs_map & (1 << fopIdx))) { - class_simple_device_add(cpint_class, + cpint_devices[i_dev].class_dev = + class_device_create(cpint_class, NULL, MKDEV(cpint_major, i_dev), NULL, cpNames[fopIdx]); cpint_devs_map |= 1 << fopIdx; - } + } else + cpint_devices[i_dev].class_dev = NULL; } - memset(cpint_devices, 0, cpint_nr_devs * sizeof (CPInt_Dev)); for (dev = cpint_devices, i_dev = 0; i_dev < cpint_nr_devs; dev++, i_dev++) init_waitqueue_head(&dev->devWait); @@ -386,11 +388,11 @@ fopIdx = fopMap[i_dev]; if (fopIdx > -1 && (cpint_devs_map & (1 << fopIdx))) { - class_simple_device_remove(MKDEV(cpint_major, i_dev)); + class_device_unregister(cpint_devices[i_dev].class_dev); } } cpint_devs_map = 0; - class_simple_destroy(cpint_class); + class_destroy(cpint_class); unregister_chrdev(cpint_major, "cpint"); for (i_dev = 0; i_dev < CPINT_NR_DEVS; i_dev++) { diff -Naur cpint-2.5.3.orig/cpint.h cpint-2.5.3/cpint.h --- cpint-2.5.3.orig/cpint.h 2006-03-01 14:00:11.465720352 +0100 +++ cpint-2.5.3/cpint.h 2006-03-01 13:48:52.050007240 +0100 @@ -30,6 +30,7 @@ uid_t devOwner; /* Current owner of device */ int devLock; /* Lock word for device */ wait_queue_head_t devWait; /* Wait queue for device */ + struct class_device *class_dev; /* sysfs device */ } CPInt_Dev; #define count_t unsigned long