diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 22:25:19 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 22:25:19 +0200 |
commit | 0d1bad216c43bcee84cc24d1ed003c19134d2645 (patch) | |
tree | 3cdcf7592c4e1a8899cde78beb512bffa21abf77 /drivers/ide/ide-dma.c | |
parent | 7ebe5936c214c656a1625abf9ec3b09e3d1bf34a (diff) | |
download | linux-0d1bad216c43bcee84cc24d1ed003c19134d2645.tar.gz linux-0d1bad216c43bcee84cc24d1ed003c19134d2645.tar.bz2 linux-0d1bad216c43bcee84cc24d1ed003c19134d2645.zip |
ide: manage resources for PCI devices in ide_pci_enable() (take 3)
* Reserve PCI BARs 0-3 (0-1 for single port controllers) in
ide_pci_enable() and remove ide_hwif_request_regions() call
from ide_device_add_all() (also cleanup resource management
in scc_pata host driver).
* Fix handling of PCI BAR 4 in ide_pci_enable(), then cleanup
ide_iomio_dma() (+ init_hwif_trm290() in trm290 host driver)
and remove ide_release[_iomio]_dma().
v2:
* Fixup trm290 host driver.
v3:
* Because of scc_pata host driver changes we need to call
pci_request_selected_regions() also in setup_mmio_scc().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index dc4bc06f9871..986ec465cb77 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -810,7 +810,7 @@ void ide_dma_timeout (ide_drive_t *drive) EXPORT_SYMBOL(ide_dma_timeout); -static void ide_release_dma_engine(ide_hwif_t *hwif) +void ide_release_dma_engine(ide_hwif_t *hwif) { if (hwif->dmatable_cpu) { struct pci_dev *pdev = to_pci_dev(hwif->dev); @@ -821,27 +821,6 @@ static void ide_release_dma_engine(ide_hwif_t *hwif) } } -static int ide_release_iomio_dma(ide_hwif_t *hwif) -{ - release_region(hwif->dma_base, 8); - if (hwif->extra_ports) - release_region(hwif->extra_base, hwif->extra_ports); - return 1; -} - -/* - * Needed for allowing full modular support of ide-driver - */ -int ide_release_dma(ide_hwif_t *hwif) -{ - ide_release_dma_engine(hwif); - - if (hwif->mmio) - return 1; - else - return ide_release_iomio_dma(hwif); -} - static int ide_allocate_dma_engine(ide_hwif_t *hwif) { struct pci_dev *pdev = to_pci_dev(hwif->dev); @@ -871,25 +850,9 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base) printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx", hwif->name, base, base + 7); - if (!request_region(base, 8, hwif->name)) { - printk(" -- Error, ports in use.\n"); - return 1; - } - - if (hwif->cds->extra) { + if (hwif->cds->extra) hwif->extra_base = base + (hwif->channel ? 8 : 16); - if (!hwif->mate || !hwif->mate->extra_ports) { - if (!request_region(hwif->extra_base, - hwif->cds->extra, hwif->cds->name)) { - printk(" -- Error, extra ports in use.\n"); - release_region(base, 8); - return 1; - } - hwif->extra_ports = hwif->cds->extra; - } - } - return 0; } @@ -909,7 +872,7 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base) return; if (ide_allocate_dma_engine(hwif)) { - ide_release_dma(hwif); + ide_release_dma_engine(hwif); return; } |