Commit 56f46f8c authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Jeff Garzik

pata_hpt37x: use ATA_DMA_* constants

Use ATA_DMA_* constants instead of the bare numbers for the BMIDE registers.
Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 4805a1b0
...@@ -461,24 +461,25 @@ static void hpt370_bmdma_stop(struct ata_queued_cmd *qc) ...@@ -461,24 +461,25 @@ static void hpt370_bmdma_stop(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u8 dma_stat = ioread8(ap->ioaddr.bmdma_addr + 2);
u8 dma_cmd;
void __iomem *bmdma = ap->ioaddr.bmdma_addr; void __iomem *bmdma = ap->ioaddr.bmdma_addr;
u8 dma_stat = ioread8(bmdma + ATA_DMA_STATUS);
u8 dma_cmd;
if (dma_stat & 0x01) { if (dma_stat & ATA_DMA_ACTIVE) {
udelay(20); udelay(20);
dma_stat = ioread8(bmdma + 2); dma_stat = ioread8(bmdma + ATA_DMA_STATUS);
} }
if (dma_stat & 0x01) { if (dma_stat & ATA_DMA_ACTIVE) {
/* Clear the engine */ /* Clear the engine */
pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
udelay(10); udelay(10);
/* Stop DMA */ /* Stop DMA */
dma_cmd = ioread8(bmdma ); dma_cmd = ioread8(bmdma + ATA_DMA_CMD);
iowrite8(dma_cmd & 0xFE, bmdma); iowrite8(dma_cmd & ~ATA_DMA_START, bmdma + ATA_DMA_CMD);
/* Clear Error */ /* Clear Error */
dma_stat = ioread8(bmdma + 2); dma_stat = ioread8(bmdma + ATA_DMA_STATUS);
iowrite8(dma_stat | 0x06 , bmdma + 2); iowrite8(dma_stat | ATA_DMA_INTR | ATA_DMA_ERR,
bmdma + ATA_DMA_STATUS);
/* Clear the engine */ /* Clear the engine */
pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
udelay(10); udelay(10);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment