ide: add drive->pio_mode field
[safe/jmp/linux-2.6] / drivers / ide / ide-floppy.c
index 060c893..fefbdfc 100644 (file)
@@ -77,7 +77,8 @@ static int ide_floppy_callback(ide_drive_t *drive, int dsc)
            (rq && blk_pc_request(rq)))
                uptodate = 1; /* FIXME */
        else if (pc->c[0] == GPCMD_REQUEST_SENSE) {
-               u8 *buf = pc->buf;
+
+               u8 *buf = bio_data(rq->bio);
 
                if (!pc->error) {
                        floppy->sense_key = buf[2] & 0x0F;
@@ -209,8 +210,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive,
        pc->rq = rq;
        if (rq->cmd_flags & REQ_RW)
                pc->flags |= PC_FLAG_WRITING;
-       pc->buf = NULL;
-       pc->buf_size = blk_rq_bytes(rq);
+
        pc->flags |= PC_FLAG_DMA_OK;
 }
 
@@ -225,9 +225,6 @@ static void idefloppy_blockpc_cmd(struct ide_disk_obj *floppy,
                if (rq_data_dir(rq) == WRITE)
                        pc->flags |= PC_FLAG_WRITING;
        }
-       /* pio will be performed by ide_pio_bytes() which handles sg fine */
-       pc->buf = NULL;
-       pc->buf_size = blk_rq_bytes(rq);
 }
 
 static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
@@ -272,10 +269,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
        } else if (blk_pc_request(rq)) {
                pc = &floppy->queued_pc;
                idefloppy_blockpc_cmd(floppy, pc, rq);
-       } else {
-               blk_dump_rq_flags(rq, PFX "unsupported command in queue");
-               goto out_end;
-       }
+       } else
+               BUG();
 
        ide_prep_sense(drive, rq);
 
@@ -298,7 +293,7 @@ out_end:
        drive->failed_pc = NULL;
        if (blk_fs_request(rq) == 0 && rq->errors == 0)
                rq->errors = -EIO;
-       ide_complete_rq(drive, -EIO, ide_rq_bytes(rq));
+       ide_complete_rq(drive, -EIO, blk_rq_bytes(rq));
        return ide_stopped;
 }
 
@@ -387,8 +382,6 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
        drive->capacity64 = 0;
 
        ide_floppy_create_read_capacity_cmd(&pc);
-       pc.buf_size = sizeof(pc_buf);
-
        if (ide_queue_pc_tail(drive, disk, &pc, pc_buf, pc.req_xfer)) {
                printk(KERN_ERR PFX "Can't get floppy parameters\n");
                return 1;