From affe3bf7876c74feb9cccc591bd594745261df1a Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Mon, 11 Jun 2007 11:40:07 +0200 Subject: [PATCH] --- yaml --- r: 57931 b: refs/heads/master c: 374abf2cb16a9df8be96675c606996458872e8b3 h: refs/heads/master i: 57929: fbe0074eb911522a4caec2ad681c9b45732a43f6 57927: 49012fd79f3f1935ac808328ab34eefe606e2a9a v: v3 --- [refs] | 2 +- trunk/drivers/ata/pata_it821x.c | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 12a498d8adec..b2dbd995d60d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9f7897554eeca34ec23dd877cc27402bd327a1ce +refs/heads/master: 374abf2cb16a9df8be96675c606996458872e8b3 diff --git a/trunk/drivers/ata/pata_it821x.c b/trunk/drivers/ata/pata_it821x.c index b3456d7a592c..525c9c142891 100644 --- a/trunk/drivers/ata/pata_it821x.c +++ b/trunk/drivers/ata/pata_it821x.c @@ -2,6 +2,7 @@ * pata_it821x.c - IT821x PATA for new ATA layer * (C) 2005 Red Hat Inc * Alan Cox + * (C) 2007 Bartlomiej Zolnierkiewicz * * based upon * @@ -79,7 +80,7 @@ #define DRV_NAME "pata_it821x" -#define DRV_VERSION "0.3.6" +#define DRV_VERSION "0.3.7" struct it821x_dev { @@ -460,14 +461,8 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused) { - int dma_enabled = 0; int i; - /* Bits 5 and 6 indicate if DMA is active on master/slave */ - /* It is possible that BMDMA isn't allocated */ - if (ap->ioaddr.bmdma_addr) - dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD); - for (i = 0; i < ATA_MAX_DEVICES; i++) { struct ata_device *dev = &ap->device[i]; if (ata_dev_enabled(dev)) { @@ -476,7 +471,7 @@ static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused dev->dma_mode = XFER_MW_DMA_0; /* We do need the right mode information for DMA or PIO and this comes from the current configuration flags */ - if (dma_enabled & (1 << (5 + i))) { + if (ata_id_has_dma(dev->id)) { ata_dev_printk(dev, KERN_INFO, "configured for DMA\n"); dev->xfer_mode = XFER_MW_DMA_0; dev->xfer_shift = ATA_SHIFT_MWDMA;