diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 14:46:43 +0300 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 14:46:43 +0300 |
commit | 6902a5331256e1b9f4cef95a1e3622252113b260 (patch) | |
tree | f33ef1a732425e1862fcf0bbd0e909f82d247a8a /drivers/ide/ide-io.c | |
parent | 37245aabfa0c628ba884cd88fe5cd633b426a1b2 (diff) | |
download | linux-6902a5331256e1b9f4cef95a1e3622252113b260.tar.xz |
ide: pass error value to ide_complete_rq()
Set rq->errors at ide_complete_rq() call sites and then pass
error value to ide_complete_rq().
[ Some rq->errors assignments look really wrong but this patch
leaves them alone to not introduce too many changes at once. ]
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index c38426de6041..4cc2bb13f1d6 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -144,17 +144,14 @@ 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, u8 err) +void ide_complete_rq(ide_drive_t *drive, int error) { ide_hwif_t *hwif = drive->hwif; struct request *rq = hwif->rq; hwif->rq = NULL; - rq->errors = err; - - if (unlikely(blk_end_request(rq, (rq->errors ? -EIO : 0), - blk_rq_bytes(rq)))) + if (unlikely(blk_end_request(rq, error, blk_rq_bytes(rq)))) BUG(); } EXPORT_SYMBOL(ide_complete_rq); @@ -166,13 +163,14 @@ void ide_kill_rq(ide_drive_t *drive, struct request *rq) drive->failed_pc = NULL; - if ((media == ide_floppy && drv_req) || media == ide_tape) - rq->errors = IDE_DRV_ERROR_GENERAL; - - if ((media == ide_floppy || media == ide_tape) && drv_req) + if ((media == ide_floppy || media == ide_tape) && drv_req) { + rq->errors = 0; ide_complete_rq(drive, 0); - else + } else { + if (media == ide_tape) + rq->errors = IDE_DRV_ERROR_GENERAL; ide_end_request(drive, 0, 0); + } } static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf) @@ -312,6 +310,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, #ifdef DEBUG printk("%s: DRIVE_CMD (null)\n", drive->name); #endif + rq->errors = 0; ide_complete_rq(drive, 0); return ide_stopped; |