summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 28ac463dde1..4a79d28600f 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -141,15 +141,17 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
kfree(cmd);
}
-void ide_complete_rq(ide_drive_t *drive, int error)
+int ide_complete_rq(ide_drive_t *drive, int error)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->rq;
+ int rc;
- hwif->rq = NULL;
+ rc = blk_end_request(rq, error, blk_rq_bytes(rq));
+ if (rc == 0)
+ hwif->rq = NULL;
- if (unlikely(blk_end_request(rq, error, blk_rq_bytes(rq))))
- BUG();
+ return rc;
}
EXPORT_SYMBOL(ide_complete_rq);