Commit 6cd5b33c authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] cleanup taskfile submit

We don't need to care about the request, just look purely at the
taskfile itself.
parent 6f59b75a
...@@ -183,39 +183,30 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) ...@@ -183,39 +183,30 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
return task->prehandler(drive, task->rq); return task->prehandler(drive, task->rq);
return ide_started; return ide_started;
} }
/* for dma commands we down set the handler */
if (blk_fs_request(task->rq) && drive->using_dma) { if (!drive->using_dma)
if (rq_data_dir(task->rq) == READ) { return ide_stopped;
switch (taskfile->command) {
case WIN_WRITEDMA_ONCE:
case WIN_WRITEDMA:
case WIN_WRITEDMA_EXT:
if (hwif->ide_dma_write(drive))
return ide_stopped;
break;
case WIN_READDMA_ONCE:
case WIN_READDMA:
case WIN_READDMA_EXT:
case WIN_IDENTIFY_DMA:
if (hwif->ide_dma_read(drive)) if (hwif->ide_dma_read(drive))
return ide_stopped; return ide_stopped;
} else { break;
if (hwif->ide_dma_write(drive)) default:
if (task->handler == NULL)
return ide_stopped; return ide_stopped;
}
} else {
if (!drive->using_dma && (task->handler == NULL))
return ide_stopped;
switch(taskfile->command) {
case WIN_WRITEDMA_ONCE:
case WIN_WRITEDMA:
case WIN_WRITEDMA_EXT:
if (hwif->ide_dma_write(drive))
return ide_stopped;
break;
case WIN_READDMA_ONCE:
case WIN_READDMA:
case WIN_READDMA_EXT:
case WIN_IDENTIFY_DMA:
if (hwif->ide_dma_read(drive))
return ide_stopped;
break;
default:
if (task->handler == NULL)
return ide_stopped;
}
} }
return ide_started;
return ide_stopped;
} }
EXPORT_SYMBOL(do_rw_taskfile); EXPORT_SYMBOL(do_rw_taskfile);
......
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