aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/kernel/pci.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-08-04 21:06:21 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-05 00:32:46 -0400
commit43c34735524d5b1c9b9e5d63b49dd4c1b394bde4 (patch)
treea61c11d4075f149be9c0aae6b6c0a935c94571af /arch/ppc/kernel/pci.c
parentfec59a711eef002d4ef9eb8de09dd0a26986eb77 (diff)
[PATCH] pci and yenta: pcibios_bus_to_resource
In yenta_socket, we default to using the resource setting of the CardBus bridge. However, this is a PCI-bus-centric view of resources and thus needs to be converted to generic resources first. Therefore, add a call to pcibios_bus_to_resource() call in between. This function is a mere wrapper on x86 and friends, however on some others it already exists, is added in this patch (alpha, arm, ppc, ppc64) or still needs to be provided (parisc -- where is its pcibios_resource_to_bus() ?). Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc/kernel/pci.c')
-rw-r--r--arch/ppc/kernel/pci.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 70cfb6ffd877..7b3586a3bf30 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -160,6 +160,21 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
160} 160}
161EXPORT_SYMBOL(pcibios_resource_to_bus); 161EXPORT_SYMBOL(pcibios_resource_to_bus);
162 162
163void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
164 struct pci_bus_region *region)
165{
166 unsigned long offset = 0;
167 struct pci_controller *hose = dev->sysdata;
168
169 if (hose && res->flags & IORESOURCE_IO)
170 offset = (unsigned long)hose->io_base_virt - isa_io_base;
171 else if (hose && res->flags & IORESOURCE_MEM)
172 offset = hose->pci_mem_offset;
173 res->start = region->start + offset;
174 res->end = region->end + offset;
175}
176EXPORT_SYMBOL(pcibios_bus_to_resource);
177
163/* 178/*
164 * We need to avoid collisions with `mirrored' VGA ports 179 * We need to avoid collisions with `mirrored' VGA ports
165 * and other strange ISA hardware, so we always want the 180 * and other strange ISA hardware, so we always want the