ide: convert do_rw_taskfile() to use ->data_phase

* Use task->data_phase in do_rw_taskfile() to decide what to do.

* task->prehandler is only used by TASKFILE[_MULTI]_OUT so just
  use pre_task_out_intr() directly and remove no longer needed
  'prehandler' field from ide_task_t.

* Remove no longer needed ide_pre_handler_t type.

There should be no functionality changes caused by this patch.
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 1edee60e
...@@ -170,23 +170,25 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) ...@@ -170,23 +170,25 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
ide_tf_load(drive, task); ide_tf_load(drive, task);
if (task->handler != NULL) { switch (task->data_phase) {
if (task->prehandler != NULL) { case TASKFILE_MULTI_OUT:
hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG); case TASKFILE_OUT:
ndelay(400); /* FIXME */ hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG);
return task->prehandler(drive, task->rq); ndelay(400); /* FIXME */
} return pre_task_out_intr(drive, task->rq);
case TASKFILE_MULTI_IN:
case TASKFILE_IN:
case TASKFILE_NO_DATA:
ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL); ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL);
return ide_started; return ide_started;
} default:
if (task_dma_ok(task) == 0 || drive->using_dma == 0 ||
if (task_dma_ok(task) && drive->using_dma && !hwif->dma_setup(drive)) { hwif->dma_setup(drive))
return ide_stopped;
hwif->dma_exec_cmd(drive, tf->command); hwif->dma_exec_cmd(drive, tf->command);
hwif->dma_start(drive); hwif->dma_start(drive);
return ide_started; return ide_started;
} }
return ide_stopped;
} }
/* /*
...@@ -665,7 +667,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) ...@@ -665,7 +667,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
} }
/* fall through */ /* fall through */
case TASKFILE_OUT: case TASKFILE_OUT:
args.prehandler = &pre_task_out_intr;
args.handler = &task_out_intr; args.handler = &task_out_intr;
/* fall through */ /* fall through */
case TASKFILE_OUT_DMAQ: case TASKFILE_OUT_DMAQ:
......
...@@ -626,7 +626,6 @@ typedef struct hwif_s { ...@@ -626,7 +626,6 @@ typedef struct hwif_s {
/* /*
* internal ide interrupt handler type * internal ide interrupt handler type
*/ */
typedef ide_startstop_t (ide_pre_handler_t)(ide_drive_t *, struct request *);
typedef ide_startstop_t (ide_handler_t)(ide_drive_t *); typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
typedef int (ide_expiry_t)(ide_drive_t *); typedef int (ide_expiry_t)(ide_drive_t *);
...@@ -950,7 +949,6 @@ typedef struct ide_task_s { ...@@ -950,7 +949,6 @@ typedef struct ide_task_s {
}; };
u32 tf_flags; u32 tf_flags;
int data_phase; int data_phase;
ide_pre_handler_t *prehandler;
ide_handler_t *handler; ide_handler_t *handler;
struct request *rq; /* copy of request */ struct request *rq; /* copy of request */
void *special; /* valid_t generally */ void *special; /* valid_t generally */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment