diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:05 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:05 -0400 |
commit | 5ed57ad705d6b58386ac43d2ca1c8fc66aee1101 (patch) | |
tree | b825d1592475337d55d15d0d01aaf8fa5ac6ba55 /drivers | |
parent | c4c69e21b51005e24e2fc4efc8a73460a5ab7799 (diff) |
ide-cd: cleanup ide_cd_do_request()
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-cd.c | 15 |
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); |
1077 | out_end: | 1082 | out_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) |