cd->needs_sector_size = 1; 
static int sr_probe(struct device *dev){	struct scsi_device *sdev = to_scsi_device(dev);	struct gendisk *disk;	struct scsi_cd *cd;	int minor, error;	error = -ENODEV;	if (sdev->type != TYPE_ROM && sdev->type != TYPE_WORM)		goto fail;	error = -ENOMEM;	cd = kmalloc(sizeof(*cd), GFP_KERNEL);	if (!cd)		goto fail;	memset(cd, 0, sizeof(*cd));	kref_init(&cd->kref);	disk = alloc_disk(1);	if (!disk)		goto fail_free;	spin_lock(&sr_index_lock);	minor = find_first_zero_bit(sr_index_bits, SR_DISKS);	if (minor == SR_DISKS) {		spin_unlock(&sr_index_lock);		error = -EBUSY;		goto fail_put;	}	__set_bit(minor, sr_index_bits);	spin_unlock(&sr_index_lock);	disk->major = SCSI_CDROM_MAJOR;	disk->first_minor = minor;	sprintf(disk->disk_name, "sr%d", minor);	disk->fops = &sr_bdops;	disk->flags = GENHD_FL_CD;	cd->device = sdev;	cd->disk = disk;	cd->driver = &sr_template;	cd->disk = disk;	cd->capacity = 0x1fffff;	cd->needs_sector_size = 1;	cd->device->changed = 1;	/* force recheck CD type */	cd->use = 1;	cd->readcd_known = 0;	cd->readcd_cdda = 0;	cd->cdi.ops = &sr_dops;	cd->cdi.handle = cd;	cd->cdi.mask = 0;	cd->cdi.capacity = 1;	sprintf(cd->cdi.name, "sr%d", minor);	sdev->sector_size = 2048;	/* A guess, just in case */	/* FIXME: need to handle a get_capabilities failure properly ?? */	get_capabilities(cd);	sr_vendor_init(cd);	snprintf(disk->devfs_name, sizeof(disk->devfs_name),			"%s/cd", sdev->devfs_name);	disk->driverfs_dev = &sdev->sdev_gendev;	set_capacity(disk, cd->capacity);	disk->private_data = &cd->driver;	disk->queue = sdev->request_queue;	cd->cdi.disk = disk;	if (register_cdrom(&cd->cdi))		goto fail_put;	dev_set_drvdata(dev, cd);	disk->flags |= GENHD_FL_REMOVABLE;	add_disk(disk);	printk(KERN_DEBUG	    "Attached scsi CD-ROM %s at scsi%d, channel %d, id %d, lun %d\n",	    cd->cdi.name, sdev->host->host_no, sdev->channel,	    sdev->id, sdev->lun);	return 0;fail_put:	put_disk(disk);fail_free:	kfree(cd);fail:	return error;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/51490c89f95b8581782e9baa855da166441852be/sr.c/clean/drivers/scsi/sr.c