[PATCH] Add pcibios_bus_to_resource for parisc
authorDominik Brodowski <linux@dominikbrodowski.net>
Wed, 27 Jul 2005 18:43:44 +0000 (11:43 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 27 Jul 2005 23:25:51 +0000 (16:25 -0700)
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/parisc/kernel/pci.c

index 3cb08a4a513ab4e4f7e3f8d15e8ea227ad692ef9..e6a891a0cad05429afd83a4ecfdcd51e33206ebb 100644 (file)
@@ -255,8 +255,26 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev,
        pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]);
 }
 
+void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+                             struct pci_bus_region *region)
+{
+       struct pci_bus *bus = dev->bus;
+       struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data);
+
+       if (res->flags & IORESOURCE_MEM) {
+               res->start = PCI_HOST_ADDR(hba, region->start);
+               res->end = PCI_HOST_ADDR(hba, region->end);
+       }
+
+       if (res->flags & IORESOURCE_IO) {
+               res->start = region->start;
+               res->end = region->end;
+       }
+}
+
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pcibios_resource_to_bus);
+EXPORT_SYMBOL(pcibios_bus_to_resource);
 #endif
 
 /*