diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 12:46:29 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 12:46:29 +0100 |
commit | e120237c0e4d9a83c1380f5ff7b5f2ba31f1c820 (patch) | |
tree | 147f0f9b228dce62f595a304e8d00868460d5cfe | |
parent | 3616b6536a74ff1c56029c17cbb3575c69c0a574 (diff) |
ide: factor out completion of taskfile from ide_end_drive_cmd()
Factor out completion of taskfile from ide_end_drive_cmd()
to ide_complete_task().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-io.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 49b098de367..b8426e9c090 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -144,6 +144,20 @@ int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, } EXPORT_SYMBOL_GPL(ide_end_dequeued_request); +static void ide_complete_task(ide_drive_t *drive, ide_task_t *task, + u8 stat, u8 err) +{ + struct ide_taskfile *tf = &task->tf; + + tf->error = err; + tf->status = stat; + + drive->hwif->tp_ops->tf_read(drive, task); + + if (task->tf_flags & IDE_TFLAG_DYN) + kfree(task); +} + /** * ide_end_drive_cmd - end an explicit drive command * @drive: command @@ -166,17 +180,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { ide_task_t *task = (ide_task_t *)rq->special; - if (task) { - struct ide_taskfile *tf = &task->tf; - - tf->error = err; - tf->status = stat; - - drive->hwif->tp_ops->tf_read(drive, task); - - if (task->tf_flags & IDE_TFLAG_DYN) - kfree(task); - } + if (task) + ide_complete_task(drive, task, stat, err); } else if (blk_pm_request(rq)) { ide_complete_pm_rq(drive, rq); return; |