]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/ide-scsi.c
[PATCH] ide-scsi: fix for IDE probe/remove ops changes
[linux-2.6-omap-h63xx.git] / drivers / scsi / ide-scsi.c
index c888af4a45629cf8fa138dabcc99646f8199723d..0cf0e4c7ac0c751645945efdf29d582a1ac3ef36 100644 (file)
@@ -395,6 +395,7 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs)
        int log = test_bit(IDESCSI_LOG_CMD, &scsi->log);
        struct Scsi_Host *host;
        u8 *scsi_buf;
+       int errors = rq->errors;
        unsigned long flags;
 
        if (!(rq->flags & (REQ_SPECIAL|REQ_SENSE))) {
@@ -421,11 +422,11 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs)
                        printk (KERN_WARNING "ide-scsi: %s: timed out for %lu\n",
                                        drive->name, pc->scsi_cmd->serial_number);
                pc->scsi_cmd->result = DID_TIME_OUT << 16;
-       } else if (rq->errors >= ERROR_MAX) {
+       } else if (errors >= ERROR_MAX) {
                pc->scsi_cmd->result = DID_ERROR << 16;
                if (log)
                        printk ("ide-scsi: %s: I/O error for %lu\n", drive->name, pc->scsi_cmd->serial_number);
-       } else if (rq->errors) {
+       } else if (errors) {
                if (log)
                        printk ("ide-scsi: %s: check condition for %lu\n", drive->name, pc->scsi_cmd->serial_number);
                if (!idescsi_check_condition(drive, rq))
@@ -750,9 +751,8 @@ static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi)
        idescsi_add_settings(drive);
 }
 
-static int ide_scsi_remove(struct device *dev)
+static void ide_scsi_remove(ide_drive_t *drive)
 {
-       ide_drive_t *drive = to_ide_device(dev);
        struct Scsi_Host *scsihost = drive->driver_data;
        struct ide_scsi_obj *scsi = scsihost_to_idescsi(scsihost);
        struct gendisk *g = scsi->disk;
@@ -767,11 +767,9 @@ static int ide_scsi_remove(struct device *dev)
 
        scsi_remove_host(scsihost);
        ide_scsi_put(scsi);
-
-       return 0;
 }
 
-static int ide_scsi_probe(struct device *);
+static int ide_scsi_probe(ide_drive_t *);
 
 #ifdef CONFIG_PROC_FS
 static ide_proc_entry_t idescsi_proc[] = {
@@ -783,13 +781,13 @@ static ide_proc_entry_t idescsi_proc[] = {
 #endif
 
 static ide_driver_t idescsi_driver = {
-       .owner                  = THIS_MODULE,
        .gen_driver = {
+               .owner          = THIS_MODULE,
                .name           = "ide-scsi",
                .bus            = &ide_bus_type,
-               .probe          = ide_scsi_probe,
-               .remove         = ide_scsi_remove,
        },
+       .probe                  = ide_scsi_probe,
+       .remove                 = ide_scsi_remove,
        .version                = IDESCSI_VERSION,
        .media                  = ide_scsi,
        .supports_dsc_overlap   = 0,
@@ -881,7 +879,7 @@ static inline int should_transform(ide_drive_t *drive, struct scsi_cmnd *cmd)
        struct gendisk *disk = cmd->request->rq_disk;
 
        if (disk) {
-               struct Scsi_Device_Template **p = disk->private_data;
+               struct struct scsi_device_Template **p = disk->private_data;
                if (strcmp((*p)->scsi_driverfs_driver.name, "sg") == 0)
                        return test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
        }
@@ -1045,7 +1043,7 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
 
        /* kill current request */
        blkdev_dequeue_request(req);
-       end_that_request_last(req);
+       end_that_request_last(req, 0);
        if (req->flags & REQ_SENSE)
                kfree(scsi->pc->buffer);
        kfree(scsi->pc);
@@ -1055,7 +1053,7 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
        /* now nuke the drive queue */
        while ((req = elv_next_request(drive->queue))) {
                blkdev_dequeue_request(req);
-               end_that_request_last(req);
+               end_that_request_last(req, 0);
        }
 
        HWGROUP(drive)->rq = NULL;
@@ -1118,9 +1116,8 @@ static struct scsi_host_template idescsi_template = {
        .proc_name              = "ide-scsi",
 };
 
-static int ide_scsi_probe(struct device *dev)
+static int ide_scsi_probe(ide_drive_t *drive)
 {
-       ide_drive_t *drive = to_ide_device(dev);
        idescsi_scsi_t *idescsi;
        struct Scsi_Host *host;
        struct gendisk *g;