scsi: move the writeable field from struct scsi_device to struct scsi_cd
We currently set the field in common code based on the device type, but then only use it in the cdrom driver which also overrides the value previously set in the generic code. Just leave this entirely to the CDROM driver to make everyones life simpler. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
@@ -807,30 +807,6 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
|
||||
sdev->removable = (inq_result[1] & 0x80) >> 7;
|
||||
}
|
||||
|
||||
switch (sdev->type) {
|
||||
case TYPE_RBC:
|
||||
case TYPE_TAPE:
|
||||
case TYPE_DISK:
|
||||
case TYPE_PRINTER:
|
||||
case TYPE_MOD:
|
||||
case TYPE_PROCESSOR:
|
||||
case TYPE_SCANNER:
|
||||
case TYPE_MEDIUM_CHANGER:
|
||||
case TYPE_ENCLOSURE:
|
||||
case TYPE_COMM:
|
||||
case TYPE_RAID:
|
||||
case TYPE_OSD:
|
||||
sdev->writeable = 1;
|
||||
break;
|
||||
case TYPE_ROM:
|
||||
case TYPE_WORM:
|
||||
sdev->writeable = 0;
|
||||
break;
|
||||
default:
|
||||
sdev_printk(KERN_INFO, sdev, "unknown device type %d\n",
|
||||
sdev->type);
|
||||
}
|
||||
|
||||
if (sdev->type == TYPE_RBC || sdev->type == TYPE_ROM) {
|
||||
/* RBC and MMC devices can return SCSI-3 compliance and yet
|
||||
* still not support REPORT LUNS, so make them act as
|
||||
|
Reference in New Issue
Block a user