sg_class_member = class_device_create(sg_sysfs_class, 
sg_class_member = class_device_create(sg_sysfs_class, NULL, 
sg_add(struct class_device *cl_dev, struct class_interface *cl_intf){	struct scsi_device *scsidp = to_scsi_device(cl_dev->dev);	struct gendisk *disk;	Sg_device *sdp = NULL;	struct cdev * cdev = NULL;	int error, k;	disk = alloc_disk(1);	if (!disk) {		printk(KERN_WARNING "alloc_disk failed\n");		return -ENOMEM;	}	disk->major = SCSI_GENERIC_MAJOR;	error = -ENOMEM;	cdev = cdev_alloc();	if (!cdev) {		printk(KERN_WARNING "cdev_alloc failed\n");		goto out;	}	cdev->owner = THIS_MODULE;	cdev->ops = &sg_fops;	error = sg_alloc(disk, scsidp);	if (error < 0) {		printk(KERN_WARNING "sg_alloc failed\n");		goto out;	}	k = error;	sdp = sg_dev_arr[k];	devfs_mk_cdev(MKDEV(SCSI_GENERIC_MAJOR, k),			S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP,			"%s/generic", scsidp->devfs_name);	error = cdev_add(cdev, MKDEV(SCSI_GENERIC_MAJOR, k), 1);	if (error) {		devfs_remove("%s/generic", scsidp->devfs_name);		goto out;	}	sdp->cdev = cdev;	if (sg_sysfs_valid) {		struct class_device * sg_class_member;		sg_class_member = class_device_create(sg_sysfs_class,				MKDEV(SCSI_GENERIC_MAJOR, k), 				cl_dev->dev, "%s", 				disk->disk_name);		if (IS_ERR(sg_class_member))			printk(KERN_WARNING "sg_add: "				"class_device_create failed\n");		class_set_devdata(sg_class_member, sdp);		error = sysfs_create_link(&scsidp->sdev_gendev.kobj, 					  &sg_class_member->kobj, "generic");		if (error)			printk(KERN_ERR "sg_add: unable to make symlink "					"'generic' back to sg%d\n", k);	} else		printk(KERN_WARNING "sg_add: sg_sys INvalid\n");	printk(KERN_NOTICE	       "Attached scsi generic sg%d at scsi%d, channel"	       " %d, id %d, lun %d,  type %d\n", k,	       scsidp->host->host_no, scsidp->channel, scsidp->id,	       scsidp->lun, scsidp->type);	return 0;out:	put_disk(disk);	if (cdev)		cdev_del(cdev);	return error;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/53f4654272df7c51064825024340554b39c9efba/sg.c/clean/drivers/scsi/sg.c