From 47b687882c02f802dd5bbe1227effe006820246e Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 19 Oct 2007 00:30:06 +0200 Subject: ide: add IDE_HFLAG_NO_{DMA,AUTODMA} host flags Add IDE_HFLAG_NO_{DMA,AUTODMA} host flags. Convert all host drivers using ide_pci_device_t to use these flags instead of d->autodma and then remove no longer needed d->autodma. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/setup-pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/ide/setup-pci.c') diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index d5901ec9e8cc..26061fe1b712 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -428,9 +428,10 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwif_t *hwif) { u16 pcicmd; + pci_read_config_word(dev, PCI_COMMAND, &pcicmd); - if ((d->autodma == AUTODMA) || + if ((d->host_flags & IDE_HFLAG_NO_AUTODMA) == 0 || ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 0x80))) { unsigned long dma_base = ide_get_or_set_dma_base(hwif); @@ -558,7 +559,7 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a if (d->init_iops) d->init_iops(hwif); - if (d->autodma == NODMA) + if (d->host_flags & IDE_HFLAG_NO_DMA) goto bypass_legacy_dma; if(d->init_setup_dma) -- cgit v1.2.3