diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:16 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:16 -0500 |
commit | 10d90157c83d4b6743c9063c36f9e7f27aa254b6 (patch) | |
tree | e4dd04ba916fee294629f7f6354d241f4f9b0619 /drivers | |
parent | 1edee60e9d994f2b9a79b1333be39790683541fe (diff) |
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: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-taskfile.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 1a34edb183ec..5f6d01a4222c 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -170,23 +170,25 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) | |||
170 | 170 | ||
171 | ide_tf_load(drive, task); | 171 | ide_tf_load(drive, task); |
172 | 172 | ||
173 | if (task->handler != NULL) { | 173 | switch (task->data_phase) { |
174 | if (task->prehandler != NULL) { | 174 | case TASKFILE_MULTI_OUT: |
175 | hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG); | 175 | case TASKFILE_OUT: |
176 | ndelay(400); /* FIXME */ | 176 | hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG); |
177 | return task->prehandler(drive, task->rq); | 177 | ndelay(400); /* FIXME */ |
178 | } | 178 | return pre_task_out_intr(drive, task->rq); |
179 | case TASKFILE_MULTI_IN: | ||
180 | case TASKFILE_IN: | ||
181 | case TASKFILE_NO_DATA: | ||
179 | ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL); | 182 | ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL); |
180 | return ide_started; | 183 | return ide_started; |
181 | } | 184 | default: |
182 | 185 | if (task_dma_ok(task) == 0 || drive->using_dma == 0 || | |
183 | if (task_dma_ok(task) && drive->using_dma && !hwif->dma_setup(drive)) { | 186 | hwif->dma_setup(drive)) |
187 | return ide_stopped; | ||
184 | hwif->dma_exec_cmd(drive, tf->command); | 188 | hwif->dma_exec_cmd(drive, tf->command); |
185 | hwif->dma_start(drive); | 189 | hwif->dma_start(drive); |
186 | return ide_started; | 190 | return ide_started; |
187 | } | 191 | } |
188 | |||
189 | return ide_stopped; | ||
190 | } | 192 | } |
191 | 193 | ||
192 | /* | 194 | /* |
@@ -665,7 +667,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
665 | } | 667 | } |
666 | /* fall through */ | 668 | /* fall through */ |
667 | case TASKFILE_OUT: | 669 | case TASKFILE_OUT: |
668 | args.prehandler = &pre_task_out_intr; | ||
669 | args.handler = &task_out_intr; | 670 | args.handler = &task_out_intr; |
670 | /* fall through */ | 671 | /* fall through */ |
671 | case TASKFILE_OUT_DMAQ: | 672 | case TASKFILE_OUT_DMAQ: |