summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 12:46:36 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 12:46:36 +0100
commit03a2faaea8f44edfe583ddf1240948019becfbe4 (patch)
tree08cb1f71390aa1972ad4eb9eba7da48ac3a6d9ce /drivers/ide/ide-atapi.c
parent3ee38302ffc63da93eb0313053a990bb3466e275 (diff)
ide: return request status from ->pc_callback method
Make ->pc_callback method return request status and then move the request completion from ->pc_callback to ide_pc_intr(). There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index f44474b0adae..f72b5a675435 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -357,6 +357,8 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
/* No more interrupts */
if ((stat & ATA_DRQ) == 0) {
+ int uptodate;
+
debug_log("Packet command completed, %d bytes transferred\n",
pc->xferred);
@@ -395,7 +397,15 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
dsc = 1;
/* Command finished - Call the callback function */
- drive->pc_callback(drive, dsc);
+ uptodate = drive->pc_callback(drive, dsc);
+
+ if (uptodate == 0)
+ drive->failed_pc = NULL;
+
+ if (blk_special_request(rq))
+ ide_complete_rq(drive, 0);
+ else
+ ide_end_request(drive, uptodate, 0);
return ide_stopped;
}