aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 5cefe12f5622..3df5442de710 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -409,6 +409,16 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
409 if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && (stat & ATA_DSC) == 0) 409 if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && (stat & ATA_DSC) == 0)
410 dsc = 1; 410 dsc = 1;
411 411
412 /*
413 * ->pc_callback() might change rq->data_len for
414 * residual count, cache total length.
415 */
416 if (!blk_special_request(rq) &&
417 (drive->media == ide_tape && !rq->bio))
418 done = ide_rq_bytes(rq); /* FIXME */
419 else
420 done = blk_rq_bytes(rq);
421
412 /* Command finished - Call the callback function */ 422 /* Command finished - Call the callback function */
413 uptodate = drive->pc_callback(drive, dsc); 423 uptodate = drive->pc_callback(drive, dsc);
414 424
@@ -417,7 +427,6 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
417 427
418 if (blk_special_request(rq)) { 428 if (blk_special_request(rq)) {
419 rq->errors = 0; 429 rq->errors = 0;
420 done = blk_rq_bytes(rq);
421 error = 0; 430 error = 0;
422 } else { 431 } else {
423 432
@@ -426,11 +435,6 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
426 rq->errors = -EIO; 435 rq->errors = -EIO;
427 } 436 }
428 437
429 if (drive->media == ide_tape && !rq->bio)
430 done = ide_rq_bytes(rq); /* FIXME */
431 else
432 done = blk_rq_bytes(rq);
433
434 error = uptodate ? 0 : -EIO; 438 error = uptodate ? 0 : -EIO;
435 } 439 }
436 440