aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:29 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:29 -0400
commite120237c0e4d9a83c1380f5ff7b5f2ba31f1c820 (patch)
tree147f0f9b228dce62f595a304e8d00868460d5cfe /drivers
parent3616b6536a74ff1c56029c17cbb3575c69c0a574 (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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-io.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 49b098de367c..b8426e9c0906 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,
144} 144}
145EXPORT_SYMBOL_GPL(ide_end_dequeued_request); 145EXPORT_SYMBOL_GPL(ide_end_dequeued_request);
146 146
147static void ide_complete_task(ide_drive_t *drive, ide_task_t *task,
148 u8 stat, u8 err)
149{
150 struct ide_taskfile *tf = &task->tf;
151
152 tf->error = err;
153 tf->status = stat;
154
155 drive->hwif->tp_ops->tf_read(drive, task);
156
157 if (task->tf_flags & IDE_TFLAG_DYN)
158 kfree(task);
159}
160
147/** 161/**
148 * ide_end_drive_cmd - end an explicit drive command 162 * ide_end_drive_cmd - end an explicit drive command
149 * @drive: command 163 * @drive: command
@@ -166,17 +180,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
166 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { 180 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
167 ide_task_t *task = (ide_task_t *)rq->special; 181 ide_task_t *task = (ide_task_t *)rq->special;
168 182
169 if (task) { 183 if (task)
170 struct ide_taskfile *tf = &task->tf; 184 ide_complete_task(drive, task, stat, err);
171
172 tf->error = err;
173 tf->status = stat;
174
175 drive->hwif->tp_ops->tf_read(drive, task);
176
177 if (task->tf_flags & IDE_TFLAG_DYN)
178 kfree(task);
179 }
180 } else if (blk_pm_request(rq)) { 185 } else if (blk_pm_request(rq)) {
181 ide_complete_pm_rq(drive, rq); 186 ide_complete_pm_rq(drive, rq);
182 return; 187 return;