]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide: remove ->data_phase field from ide_hwif_t
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:32 +0000 (12:46 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:32 +0000 (12:46 +0100)
* Always use hwif->task->data_phase and remove ->data_phase
  field from ide_hwif_t.

* Remove superfluous REQ_TYPE_ATA_TASKFILE check from
  ide_pio_datablock() while at it.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-disk.c
drivers/ide/ide-io.c
drivers/ide/ide-park.c
drivers/ide/ide-taskfile.c
include/linux/ide.h

index 806760d24cefd263e4ab8202a3659053be40f3f9..0f196e5fcff39aa0155b6ebf75561f526020f6f9 100644 (file)
@@ -160,8 +160,6 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
                task.tf_flags |= IDE_TFLAG_WRITE;
 
        ide_tf_set_cmd(drive, &task, dma);
-       if (!dma)
-               hwif->data_phase = task.data_phase;
        task.rq = rq;
 
        rc = do_rw_taskfile(drive, &task);
@@ -170,7 +168,6 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
                /* fallback to PIO */
                task.tf_flags |= IDE_TFLAG_DMA_PIO_FALLBACK;
                ide_tf_set_cmd(drive, &task, 0);
-               hwif->data_phase = task.data_phase;
                ide_init_sg_cmd(drive, rq);
                rc = do_rw_taskfile(drive, &task);
        }
index 45fc18ff73cb22c9c55662d5878bf5c55b930e41..38076169b89308d0a9a0c5e284e385f4af4a1768 100644 (file)
@@ -310,13 +310,10 @@ EXPORT_SYMBOL_GPL(ide_init_sg_cmd);
 static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
                struct request *rq)
 {
-       ide_hwif_t *hwif = drive->hwif;
        ide_task_t *task = rq->special;
 
        if (task) {
-               hwif->data_phase = task->data_phase;
-
-               switch (hwif->data_phase) {
+               switch (task->data_phase) {
                case TASKFILE_MULTI_OUT:
                case TASKFILE_OUT:
                case TASKFILE_MULTI_IN:
index f30e52152fcbf1e2d3609998ef282eaf6b9a5f21..cddc7c7787608a518a320a1579c4b66fce196844 100644 (file)
@@ -81,7 +81,7 @@ ide_startstop_t ide_do_park_unpark(ide_drive_t *drive, struct request *rq)
 
        task.tf_flags |= IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
        task.rq = rq;
-       drive->hwif->data_phase = task.data_phase = TASKFILE_NO_DATA;
+       task.data_phase = TASKFILE_NO_DATA;
        return do_rw_taskfile(drive, &task);
 }
 
index 297cf6f4c7234ee9ce0aa1679c76f485fa449336..7237e1547b1fb5ca8d60b344102043fa688f6226 100644 (file)
@@ -265,21 +265,18 @@ static void ide_pio_multi(ide_drive_t *drive, struct request *rq,
 static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,
                                     unsigned int write)
 {
+       ide_task_t *task = &drive->hwif->task;
        u8 saved_io_32bit = drive->io_32bit;
 
        if (rq->bio)    /* fs request */
                rq->errors = 0;
 
-       if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
-               ide_task_t *task = rq->special;
-
-               if (task->tf_flags & IDE_TFLAG_IO_16BIT)
-                       drive->io_32bit = 0;
-       }
+       if (task->tf_flags & IDE_TFLAG_IO_16BIT)
+               drive->io_32bit = 0;
 
        touch_softlockup_watchdog();
 
-       switch (drive->hwif->data_phase) {
+       switch (task->data_phase) {
        case TASKFILE_MULTI_IN:
        case TASKFILE_MULTI_OUT:
                ide_pio_multi(drive, rq, write);
@@ -297,9 +294,10 @@ static ide_startstop_t task_error(ide_drive_t *drive, struct request *rq,
 {
        if (rq->bio) {
                ide_hwif_t *hwif = drive->hwif;
+               ide_task_t *task = &hwif->task;
                int sectors = hwif->nsect - hwif->nleft;
 
-               switch (hwif->data_phase) {
+               switch (task->data_phase) {
                case TASKFILE_IN:
                        if (hwif->nleft)
                                break;
@@ -431,14 +429,14 @@ static ide_startstop_t task_out_intr (ide_drive_t *drive)
 
 static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)
 {
-       ide_hwif_t *hwif = drive->hwif;
+       ide_task_t *task = &drive->hwif->task;
        ide_startstop_t startstop;
 
        if (ide_wait_stat(&startstop, drive, ATA_DRQ,
                          drive->bad_wstat, WAIT_DRQ)) {
                printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n",
                        drive->name,
-                       hwif->data_phase == TASKFILE_MULTI_OUT ? "MULT" : "",
+                       task->data_phase == TASKFILE_MULTI_OUT ? "MULT" : "",
                        (drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : "");
                return startstop;
        }
index 83bed2f4378a1270c22cb440dbf851bb40e1895e..146b07a9b6491ef128df597e376e3e98df503909 100644 (file)
@@ -768,9 +768,6 @@ typedef struct hwif_s {
        int orig_sg_nents;
        int sg_dma_direction;           /* dma transfer direction */
 
-       /* data phase of the active command (currently only valid for PIO/DMA) */
-       int             data_phase;
-
        struct ide_task_s task;         /* current command */
 
        unsigned int nsect;