misc->class = class_device_create(misc_class, dev, misc->dev, 
misc->class = class_device_create(misc_class, NULL, dev, misc->dev, 
int misc_register(struct miscdevice * misc){	struct miscdevice *c;	dev_t dev;	int err;	down(&misc_sem);	list_for_each_entry(c, &misc_list, list) {		if (c->minor == misc->minor) {			up(&misc_sem);			return -EBUSY;		}	}	if (misc->minor == MISC_DYNAMIC_MINOR) {		int i = DYNAMIC_MINORS;		while (--i >= 0)			if ( (misc_minors[i>>3] & (1 << (i&7))) == 0)				break;		if (i<0) {			up(&misc_sem);			return -EBUSY;		}		misc->minor = i;	}	if (misc->minor < DYNAMIC_MINORS)		misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);	if (misc->devfs_name[0] == '\0') {		snprintf(misc->devfs_name, sizeof(misc->devfs_name),				"misc/%s", misc->name);	}	dev = MKDEV(MISC_MAJOR, misc->minor);	misc->class = class_device_create(misc_class, dev, misc->dev,					  "%s", misc->name);	if (IS_ERR(misc->class)) {		err = PTR_ERR(misc->class);		goto out;	}	err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, 			    misc->devfs_name);	if (err) {		class_device_destroy(misc_class, dev);		goto out;	}	/*	 * Add it to the front, so that later devices can "override"	 * earlier defaults	 */	list_add(&misc->list, &misc_list); out:	up(&misc_sem);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/53f4654272df7c51064825024340554b39c9efba/misc.c/buggy/drivers/char/misc.c