X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fide%2Fide-cd.c;h=310e497b58380d5d348c29d9d890204e1cf47edf;hb=b69409279c4c960fcd1575bcf80f2a0ca414ca93;hp=ee4d458e2bbf39df4ba47069136c762893f6f304;hpb=c1f3ee120bb61045b1c0a3ead620d1d65af47130;p=linux-2.6-omap-h63xx.git diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index ee4d458e2bb..310e497b583 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -295,7 +295,8 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) int stat, err, sense_key; /* Check for errors. */ - stat = HWIF(drive)->INB(IDE_STATUS_REG); + stat = ide_read_status(drive); + if (stat_ret) *stat_ret = stat; @@ -303,7 +304,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) return 0; /* Get the IDE error register. */ - err = HWIF(drive)->INB(IDE_ERROR_REG); + err = ide_read_error(drive); sense_key = err >> 4; if (rq == NULL) { @@ -692,7 +693,7 @@ int ide_cd_check_ireason(ide_drive_t *drive, int len, int ireason, int rw) /* Some drives (ASUS) seem to tell us that status * info is available. just get it and ignore. */ - (void) HWIF(drive)->INB(IDE_STATUS_REG); + (void)ide_read_status(drive); return 0; } else { /* Drive wants a command packet, or invalid ireason... */ @@ -1206,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) end_request: if (blk_pc_request(rq)) { unsigned long flags; + unsigned int dlen = rq->data_len; + + if (dma) + rq->data_len = 0; spin_lock_irqsave(&ide_lock, flags); - if (__blk_end_request(rq, 0, rq->data_len)) + if (__blk_end_request(rq, 0, dlen)) BUG(); HWGROUP(drive)->rq = NULL; spin_unlock_irqrestore(&ide_lock, flags); @@ -1326,7 +1331,7 @@ ide_do_rw_cdrom (ide_drive_t *drive, struct request *rq, sector_t block) if (blk_fs_request(rq)) { if (info->cd_flags & IDE_CD_FLAG_SEEKING) { unsigned long elapsed = jiffies - info->start_seek; - int stat = HWIF(drive)->INB(IDE_STATUS_REG); + int stat = ide_read_status(drive); if ((stat & SEEK_STAT) != SEEK_STAT) { if (elapsed < IDECD_SEEK_TIMEOUT) { @@ -1554,7 +1559,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) if (stat) return stat; - toc->hdr.toc_length = ntohs (toc->hdr.toc_length); + toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length); if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { toc->hdr.first_track = BCD2BIN(toc->hdr.first_track);