diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-08-04 21:06:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-05 00:32:46 -0400 |
commit | 43c34735524d5b1c9b9e5d63b49dd4c1b394bde4 (patch) | |
tree | a61c11d4075f149be9c0aae6b6c0a935c94571af /arch/ppc/kernel/pci.c | |
parent | fec59a711eef002d4ef9eb8de09dd0a26986eb77 (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.c | 15 |
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 | } |
161 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 161 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
162 | 162 | ||
163 | void 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 | } | ||
176 | EXPORT_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 |