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>
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index dc4bc06..986ec46 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -810,7 +810,7 @@
 
 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 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 @@
 	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 @@
 		return;
 
 	if (ide_allocate_dma_engine(hwif)) {
-		ide_release_dma(hwif);
+		ide_release_dma_engine(hwif);
 		return;
 	}