aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:25 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:25 -0500
commit8b67ebf6dae0b0743bad1641e9691a1205adbf9e (patch)
tree7ee15827b579f11a6ded12604f30efa6a569d7cc /drivers
parent8ee69f5a83660796ffa1d33e67d0064db44cfc23 (diff)
ide-cd: unify request end exit path in cdrom_pc_intr()
This is a preparation for cdrom_pc_intr() and cdrom_newpc_intr() merge. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-cd.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 7eb1aa6a3113..6f698b4c275a 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1066,7 +1066,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
1066{ 1066{
1067 struct request *rq = HWGROUP(drive)->rq; 1067 struct request *rq = HWGROUP(drive)->rq;
1068 xfer_func_t *xferfunc = NULL; 1068 xfer_func_t *xferfunc = NULL;
1069 int stat, ireason, len, thislen, write; 1069 int stat, ireason, len, thislen, write, update;
1070 u8 lowcyl = 0, highcyl = 0; 1070 u8 lowcyl = 0, highcyl = 0;
1071 1071
1072 /* Check for errors. */ 1072 /* Check for errors. */
@@ -1084,14 +1084,8 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
1084 Complain if we still have data left to transfer. */ 1084 Complain if we still have data left to transfer. */
1085 if ((stat & DRQ_STAT) == 0) { 1085 if ((stat & DRQ_STAT) == 0) {
1086 ide_cd_request_sense_fixup(rq); 1086 ide_cd_request_sense_fixup(rq);
1087 1087 update = rq->data_len ? 0 : 1;
1088 if (rq->data_len == 0) 1088 goto end_request;
1089 cdrom_end_request(drive, 1);
1090 else {
1091 rq->cmd_flags |= REQ_FAILED;
1092 cdrom_end_request(drive, 0);
1093 }
1094 return ide_stopped;
1095 } 1089 }
1096 1090
1097 /* Figure out how much data to transfer. */ 1091 /* Figure out how much data to transfer. */
@@ -1130,9 +1124,8 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
1130 "appears confused (ireason = 0x%02x). " 1124 "appears confused (ireason = 0x%02x). "
1131 "Trying to recover by ending request.\n", 1125 "Trying to recover by ending request.\n",
1132 drive->name, ireason); 1126 drive->name, ireason);
1133 rq->cmd_flags |= REQ_FAILED; 1127 update = 0;
1134 cdrom_end_request(drive, 0); 1128 goto end_request;
1135 return ide_stopped;
1136 } 1129 }
1137pad: 1130pad:
1138 /* 1131 /*
@@ -1145,6 +1138,12 @@ pad:
1145 /* Now we wait for another interrupt. */ 1138 /* Now we wait for another interrupt. */
1146 ide_set_handler(drive, &cdrom_pc_intr, ATAPI_WAIT_PC, cdrom_timer_expiry); 1139 ide_set_handler(drive, &cdrom_pc_intr, ATAPI_WAIT_PC, cdrom_timer_expiry);
1147 return ide_started; 1140 return ide_started;
1141
1142end_request:
1143 if (!update)
1144 rq->cmd_flags |= REQ_FAILED;
1145 cdrom_end_request(drive, update);
1146 return ide_stopped;
1148} 1147}
1149 1148
1150static ide_startstop_t cdrom_do_pc_continuation (ide_drive_t *drive) 1149static ide_startstop_t cdrom_do_pc_continuation (ide_drive_t *drive)