summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 20:15:05 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 20:15:05 +0200
commit5ed57ad705d6b58386ac43d2ca1c8fc66aee1101 (patch)
treeb825d1592475337d55d15d0d01aaf8fa5ac6ba55 /drivers
parentc4c69e21b51005e24e2fc4efc8a73460a5ab7799 (diff)
downloadblackbird-op-linux-5ed57ad705d6b58386ac43d2ca1c8fc66aee1101.tar.gz
blackbird-op-linux-5ed57ad705d6b58386ac43d2ca1c8fc66aee1101.zip
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.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,
if (blk_fs_request(rq)) {
if (cdrom_start_rw(drive, rq) == ide_stopped ||
- ide_cd_prepare_rw_request(drive, rq) == ide_stopped)
+ ide_cd_prepare_rw_request(drive, rq) == ide_stopped) {
+ if (rq->current_nr_sectors == 0)
+ uptodate = 1;
goto out_end;
+ }
} else if (blk_sense_request(rq) || blk_pc_request(rq) ||
rq->cmd_type == REQ_TYPE_ATA_PC) {
if (!rq->timeout)
@@ -1063,6 +1066,8 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
goto out_end;
} else {
blk_dump_rq_flags(rq, DRV_NAME " bad flags");
+ if (rq->errors == 0)
+ rq->errors = -EIO;
goto out_end;
}
@@ -1075,14 +1080,6 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
return ide_issue_pc(drive, &cmd);
out_end:
- if (blk_fs_request(rq)) {
- if (rq->current_nr_sectors == 0)
- uptodate = 1;
- } else {
- if (uptodate <= 0 && rq->errors == 0)
- rq->errors = -EIO;
- }
-
nsectors = rq->hard_nr_sectors;
if (nsectors == 0)
OpenPOWER on IntegriCloud