]> git.hungrycats.org Git - linux/commitdiff
[PATCH] unusual_devs fixups
authorMatthew Dharm <mdharm-usb@one-eyed-alien.net>
Sun, 15 Jun 2003 14:10:59 +0000 (07:10 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 15 Jun 2003 14:10:59 +0000 (07:10 -0700)
This moves the initialization of the struct scsi_device fields
use_10_for_ms and use_10_for_rw into a central place.  This allows the
host's slave_configure() function to change them (with effect).  This
also collapses two identical sections of code into a single one.

This is needed by usb-storage, so we can resolve some Babble problems,
some device-crashing problems, and remove a great deal of troublesome
mode-sense-translation code.

drivers/scsi/scsi_scan.c
drivers/scsi/sd.c
drivers/scsi/sr.c

index 947b99663d02ff92e071e5ee91197a698d7f2e96..61cdaa7591c279c204b73e7fc1b606376273f3a4 100644 (file)
@@ -686,6 +686,9 @@ static int scsi_add_lun(Scsi_Device *sdev, char *inq_result, int *bflags)
         * function */
        sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED;
 
+       sdev->use_10_for_rw = 1;
+       sdev->use_10_for_ms = 0;
+
        if(sdev->host->hostt->slave_configure)
                sdev->host->hostt->slave_configure(sdev);
 
index e35f308e7c1f70722d8516d210ade75a392f4dae..cb572121f2b176b9e7dbb39e147c6fe38aa1a408 100644 (file)
@@ -1265,8 +1265,6 @@ sd_init_onedisk(struct scsi_disk * sdkp, struct gendisk *disk)
        if (sdkp->media_present)
                sd_read_cache_type(sdkp, disk->disk_name, SRpnt, buffer);
                
-       SRpnt->sr_device->use_10_for_rw = 1;
-       SRpnt->sr_device->use_10_for_ms = 0;
        SRpnt->sr_device->remap = 1;
 
  leave:
index a2ea53a86852db6aac7bc65c845fa132acad0842..c2c682a148155176f8fc2b8aa445490d34e2ba20 100644 (file)
@@ -524,8 +524,6 @@ static int sr_probe(struct device *dev)
        sprintf(cd->cdi.name, "sr%d", minor);
 
        sdev->sector_size = 2048;       /* A guess, just in case */
-       sdev->use_10_for_rw = 1;
-       sdev->use_10_for_ms = 0;
        sdev->remap = 1;
 
        /* FIXME: need to handle a get_capabilities failure properly ?? */