aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:26 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:26 -0500
commitc9f56a801a3a9d76119868a687bc220d29055625 (patch)
tree15facdb7b98fc753103ef6bd64f8e22979b40ca8
parenta7c7d16383748029de8187075cabbc3f5df2cd78 (diff)
ide-cd: merge cdrom_do_packet_command() and cdrom_do_block_pc()
Add REQ_TYPE_{SENSE,ATA_PC} requests handling to cdrom_do_block_pc() and remove cdrom_do_packet_command(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-cd.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 328d26c07798..6c31ce15210d 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1061,22 +1061,6 @@ static void ide_cd_request_sense_fixup(struct request *rq)
1061 } 1061 }
1062} 1062}
1063 1063
1064static ide_startstop_t cdrom_do_newpc_cont(ide_drive_t *);
1065
1066static ide_startstop_t cdrom_do_packet_command (ide_drive_t *drive)
1067{
1068 int len;
1069 struct request *rq = HWGROUP(drive)->rq;
1070 struct cdrom_info *info = drive->driver_data;
1071
1072 info->dma = 0;
1073 rq->cmd_flags &= ~REQ_FAILED;
1074 len = rq->data_len;
1075
1076 /* Start sending the command to the drive. */
1077 return cdrom_start_packet_command(drive, len, cdrom_do_newpc_cont);
1078}
1079
1080int ide_cd_queue_pc(ide_drive_t *drive, struct request *rq) 1064int ide_cd_queue_pc(ide_drive_t *drive, struct request *rq)
1081{ 1065{
1082 struct request_sense sense; 1066 struct request_sense sense;
@@ -1505,7 +1489,10 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
1505{ 1489{
1506 struct cdrom_info *info = drive->driver_data; 1490 struct cdrom_info *info = drive->driver_data;
1507 1491
1508 rq->cmd_flags |= REQ_QUIET; 1492 if (blk_pc_request(rq))
1493 rq->cmd_flags |= REQ_QUIET;
1494 else
1495 rq->cmd_flags &= ~REQ_FAILED;
1509 1496
1510 info->dma = 0; 1497 info->dma = 0;
1511 1498
@@ -1565,10 +1552,8 @@ ide_do_rw_cdrom (ide_drive_t *drive, struct request *rq, sector_t block)
1565 } 1552 }
1566 info->last_block = block; 1553 info->last_block = block;
1567 return action; 1554 return action;
1568 } else if (rq->cmd_type == REQ_TYPE_SENSE || 1555 } else if (blk_sense_request(rq) || blk_pc_request(rq) ||
1569 rq->cmd_type == REQ_TYPE_ATA_PC) { 1556 rq->cmd_type == REQ_TYPE_ATA_PC) {
1570 return cdrom_do_packet_command(drive);
1571 } else if (blk_pc_request(rq)) {
1572 return cdrom_do_block_pc(drive, rq); 1557 return cdrom_do_block_pc(drive, rq);
1573 } else if (blk_special_request(rq)) { 1558 } else if (blk_special_request(rq)) {
1574 /* 1559 /*