View | Details | Raw Unified
Collapse All | Expand All

(-) cpint-2.5.3.orig/cpint.c (-7 / +9 lines)
 Lines 131-137    Link Here 
CPInt_Dev *cpint_devices;
CPInt_Dev *cpint_devices;
static struct class_simple *cpint_class;
static struct class *cpint_class;
/*----------------------------------------------------------*/
/*----------------------------------------------------------*/
/* The different file operations                            */
/* The different file operations                            */
 Lines 309-315    Link Here 
    /*------------------------------------------------------*/
    /*------------------------------------------------------*/
	/* Register this device class                           */
	/* Register this device class                           */
    /*------------------------------------------------------*/
    /*------------------------------------------------------*/
	cpint_class = class_simple_create(THIS_MODULE, "cpint");
	cpint_class = class_create(THIS_MODULE, "cpint");
	if (IS_ERR(cpint_class)) {
	if (IS_ERR(cpint_class)) {
		printk(KERN_ERR "Error creating cpint class.\n");
		printk(KERN_ERR "Error creating cpint class.\n");
		kfree(cpint_devices);
		kfree(cpint_devices);
 Lines 320-338    Link Here 
    /*------------------------------------------------------*/
    /*------------------------------------------------------*/
	/* Register the individual devices                      */
	/* 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++) {
	for (i_dev = 0; i_dev < CPINT_NR_DEVS; i_dev++) {
		int fopIdx;
		int fopIdx;
		fopIdx = fopMap[i_dev];
		fopIdx = fopMap[i_dev];
		if (fopIdx > -1 && !(cpint_devs_map & (1 << fopIdx))) {
		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,
						MKDEV(cpint_major, i_dev), NULL,
						cpNames[fopIdx]);
						cpNames[fopIdx]);
			cpint_devs_map |= 1 << 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;
	for (dev = cpint_devices, i_dev = 0;
	     i_dev < cpint_nr_devs; dev++, i_dev++)
	     i_dev < cpint_nr_devs; dev++, i_dev++)
		init_waitqueue_head(&dev->devWait);
		init_waitqueue_head(&dev->devWait);
 Lines 386-396    Link Here 
		fopIdx = fopMap[i_dev];
		fopIdx = fopMap[i_dev];
		if (fopIdx > -1 && (cpint_devs_map & (1 << fopIdx))) {
		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;
	cpint_devs_map = 0;
	class_simple_destroy(cpint_class);
	class_destroy(cpint_class);
	unregister_chrdev(cpint_major, "cpint");
	unregister_chrdev(cpint_major, "cpint");
	for (i_dev = 0; i_dev < CPINT_NR_DEVS; i_dev++) {
	for (i_dev = 0; i_dev < CPINT_NR_DEVS; i_dev++) {
(-) cpint-2.5.3.orig/cpint.h (+1 lines)
 Lines 30-35    Link Here 
	uid_t devOwner;		/* Current owner of device   */
	uid_t devOwner;		/* Current owner of device   */
	int devLock;		/* Lock word for device      */
	int devLock;		/* Lock word for device      */
	wait_queue_head_t devWait;	/* Wait queue for device     */
	wait_queue_head_t devWait;	/* Wait queue for device     */
	struct class_device *class_dev;	/* sysfs device */
} CPInt_Dev;
} CPInt_Dev;
#define count_t unsigned long
#define count_t unsigned long