aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_hpt37x.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-12-04 15:37:43 -0500
committerJeff Garzik <jgarzik@redhat.com>2010-03-01 14:58:42 -0500
commit56f46f8c8741d02516d9150a46a5b05fe910ee11 (patch)
treee65b30e4b240fee5d37018679eec81b62f4ddf2a /drivers/ata/pata_hpt37x.c
parent4805a1b0e6d74feb6428c05116a2886a076ee341 (diff)
pata_hpt37x: use ATA_DMA_* constants
Use ATA_DMA_* constants instead of the bare numbers for the BMIDE registers. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_hpt37x.c')
-rw-r--r--drivers/ata/pata_hpt37x.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index 4224cfccede..342aaaaf383 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -461,24 +461,25 @@ static void hpt370_bmdma_stop(struct ata_queued_cmd *qc)
461{ 461{
462 struct ata_port *ap = qc->ap; 462 struct ata_port *ap = qc->ap;
463 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 463 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
464 u8 dma_stat = ioread8(ap->ioaddr.bmdma_addr + 2);
465 u8 dma_cmd;
466 void __iomem *bmdma = ap->ioaddr.bmdma_addr; 464 void __iomem *bmdma = ap->ioaddr.bmdma_addr;
465 u8 dma_stat = ioread8(bmdma + ATA_DMA_STATUS);
466 u8 dma_cmd;
467 467
468 if (dma_stat & 0x01) { 468 if (dma_stat & ATA_DMA_ACTIVE) {
469 udelay(20); 469 udelay(20);
470 dma_stat = ioread8(bmdma + 2); 470 dma_stat = ioread8(bmdma + ATA_DMA_STATUS);
471 } 471 }
472 if (dma_stat & 0x01) { 472 if (dma_stat & ATA_DMA_ACTIVE) {
473 /* Clear the engine */ 473 /* Clear the engine */
474 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); 474 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
475 udelay(10); 475 udelay(10);
476 /* Stop DMA */ 476 /* Stop DMA */
477 dma_cmd = ioread8(bmdma ); 477 dma_cmd = ioread8(bmdma + ATA_DMA_CMD);
478 iowrite8(dma_cmd & 0xFE, bmdma); 478 iowrite8(dma_cmd & ~ATA_DMA_START, bmdma + ATA_DMA_CMD);
479 /* Clear Error */ 479 /* Clear Error */
480 dma_stat = ioread8(bmdma + 2); 480 dma_stat = ioread8(bmdma + ATA_DMA_STATUS);
481 iowrite8(dma_stat | 0x06 , bmdma + 2); 481 iowrite8(dma_stat | ATA_DMA_INTR | ATA_DMA_ERR,
482 bmdma + ATA_DMA_STATUS);
482 /* Clear the engine */ 483 /* Clear the engine */
483 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); 484 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
484 udelay(10); 485 udelay(10);