mxc_nand: use DRIVER_NAME where appropriate
[safe/jmp/linux-2.6] / drivers / scsi / sr.c
index e7fa3ca..eb61f7a 100644 (file)
@@ -292,7 +292,8 @@ static int sr_done(struct scsi_cmnd *SCpnt)
                        if (cd->device->sector_size == 2048)
                                error_sector <<= 2;
                        error_sector &= ~(block_sectors - 1);
-                       good_bytes = (error_sector - SCpnt->request->sector) << 9;
+                       good_bytes = (error_sector -
+                                     blk_rq_pos(SCpnt->request)) << 9;
                        if (good_bytes < 0 || good_bytes >= this_count)
                                good_bytes = 0;
                        /*
@@ -309,15 +310,6 @@ static int sr_done(struct scsi_cmnd *SCpnt)
                        break;
 
                case RECOVERED_ERROR:
-
-                       /*
-                        * An error occured, but it recovered.  Inform the
-                        * user, but make sure that it's not treated as a
-                        * hard error.
-                        */
-                       scsi_print_sense("sr", SCpnt);
-                       SCpnt->result = 0;
-                       SCpnt->sense_buffer[0] = 0x0;
                        good_bytes = this_count;
                        break;
 
@@ -358,8 +350,8 @@ static int sr_prep_fn(struct request_queue *q, struct request *rq)
                                cd->disk->disk_name, block));
 
        if (!cd->device || !scsi_device_online(cd->device)) {
-               SCSI_LOG_HLQUEUE(2, printk("Finishing %ld sectors\n",
-                                       rq->nr_sectors));
+               SCSI_LOG_HLQUEUE(2, printk("Finishing %u sectors\n",
+                                          blk_rq_sectors(rq)));
                SCSI_LOG_HLQUEUE(2, printk("Retry with 0x%p\n", SCpnt));
                goto out;
        }
@@ -422,7 +414,7 @@ static int sr_prep_fn(struct request_queue *q, struct request *rq)
        /*
         * request doesn't start on hw block boundary, add scatter pads
         */
-       if (((unsigned int)rq->sector % (s_size >> 9)) ||
+       if (((unsigned int)blk_rq_pos(rq) % (s_size >> 9)) ||
            (scsi_bufflen(SCpnt) % s_size)) {
                scmd_printk(KERN_NOTICE, SCpnt, "unaligned transfer\n");
                goto out;
@@ -431,14 +423,14 @@ static int sr_prep_fn(struct request_queue *q, struct request *rq)
        this_count = (scsi_bufflen(SCpnt) >> 9) / (s_size >> 9);
 
 
-       SCSI_LOG_HLQUEUE(2, printk("%s : %s %d/%ld 512 byte blocks.\n",
+       SCSI_LOG_HLQUEUE(2, printk("%s : %s %d/%u 512 byte blocks.\n",
                                cd->cdi.name,
                                (rq_data_dir(rq) == WRITE) ?
                                        "writing" : "reading",
-                               this_count, rq->nr_sectors));
+                               this_count, blk_rq_sectors(rq)));
 
        SCpnt->cmnd[1] = 0;
-       block = (unsigned int)rq->sector / (s_size >> 9);
+       block = (unsigned int)blk_rq_pos(rq) / (s_size >> 9);
 
        if (this_count > 0xffff) {
                this_count = 0xffff;
@@ -533,7 +525,7 @@ static int sr_block_media_changed(struct gendisk *disk)
        return cdrom_media_changed(&cd->cdi);
 }
 
-static struct block_device_operations sr_bdops =
+static const struct block_device_operations sr_bdops =
 {
        .owner          = THIS_MODULE,
        .open           = sr_block_open,
@@ -735,7 +727,7 @@ static void get_sectorsize(struct scsi_cd *cd)
        }
 
        queue = cd->device->request_queue;
-       blk_queue_hardsect_size(queue, sector_size);
+       blk_queue_logical_block_size(queue, sector_size);
 
        return;
 }
@@ -889,6 +881,7 @@ static int sr_remove(struct device *dev)
 {
        struct scsi_cd *cd = dev_get_drvdata(dev);
 
+       blk_queue_prep_rq(cd->device->request_queue, scsi_prep_fn);
        del_gendisk(cd->disk);
 
        mutex_lock(&sr_ref_mutex);