aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cd.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 978e1c0c1722..30113e69c8bb 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1049,8 +1049,11 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
1049 1049
1050 if (blk_fs_request(rq)) { 1050 if (blk_fs_request(rq)) {
1051 if (cdrom_start_rw(drive, rq) == ide_stopped || 1051 if (cdrom_start_rw(drive, rq) == ide_stopped ||
1052 ide_cd_prepare_rw_request(drive, rq) == ide_stopped) 1052 ide_cd_prepare_rw_request(drive, rq) == ide_stopped) {
1053 if (rq->current_nr_sectors == 0)
1054 uptodate = 1;
1053 goto out_end; 1055 goto out_end;
1056 }
1054 } else if (blk_sense_request(rq) || blk_pc_request(rq) || 1057 } else if (blk_sense_request(rq) || blk_pc_request(rq) ||
1055 rq->cmd_type == REQ_TYPE_ATA_PC) { 1058 rq->cmd_type == REQ_TYPE_ATA_PC) {
1056 if (!rq->timeout) 1059 if (!rq->timeout)
@@ -1063,6 +1066,8 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
1063 goto out_end; 1066 goto out_end;
1064 } else { 1067 } else {
1065 blk_dump_rq_flags(rq, DRV_NAME " bad flags"); 1068 blk_dump_rq_flags(rq, DRV_NAME " bad flags");
1069 if (rq->errors == 0)
1070 rq->errors = -EIO;
1066 goto out_end; 1071 goto out_end;
1067 } 1072 }
1068 1073
@@ -1075,14 +1080,6 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
1075 1080
1076 return ide_issue_pc(drive, &cmd); 1081 return ide_issue_pc(drive, &cmd);
1077out_end: 1082out_end:
1078 if (blk_fs_request(rq)) {
1079 if (rq->current_nr_sectors == 0)
1080 uptodate = 1;
1081 } else {
1082 if (uptodate <= 0 && rq->errors == 0)
1083 rq->errors = -EIO;
1084 }
1085
1086 nsectors = rq->hard_nr_sectors; 1083 nsectors = rq->hard_nr_sectors;
1087 1084
1088 if (nsectors == 0) 1085 if (nsectors == 0)