summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci-common.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-03-16 17:48:09 -0600
committerJesse Barnes <jbarnes@virtuousgeek.org>2012-03-20 10:41:44 -0700
commit38973ba7903fa0660a31b2bdc50ff711ec8d08c9 (patch)
tree3035998567d13979639f24d99a5dd185d1679123 /arch/powerpc/kernel/pci-common.c
parentd85c6d97d3d2601332f8250f06738cdeb4da71d2 (diff)
powerpc/PCI: compute I/O space bus-to-resource offset consistently
Make sure we compute CPU addresses (resource start/end) the same way both when we set up the I/O aperture (hose->io_resource) and when we use pcibios_bus_to_resource() to convert BAR values into resources. This fixes a build failure ("cast from pointer to integer of different size" in configs where resource_size_t is 64 bits but pointers are 32 bits) I introduced in 6c5705fec63d. Acked-By: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r--arch/powerpc/kernel/pci-common.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 910b9dea703..2efd52d714c 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1492,6 +1492,11 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
return pci_enable_resources(dev, mask);
}
+resource_size_t pcibios_io_space_offset(struct pci_controller *hose)
+{
+ return (unsigned long) hose->io_base_virt - _IO_BASE;
+}
+
static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, struct list_head *resources)
{
struct resource *res;
@@ -1516,8 +1521,7 @@ static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, s
(unsigned long long)res->start,
(unsigned long long)res->end,
(unsigned long)res->flags);
- pci_add_resource_offset(resources, res,
- (resource_size_t) hose->io_base_virt - _IO_BASE);
+ pci_add_resource_offset(resources, res, pcibios_io_space_offset(hose));
/* Hookup PHB Memory resources */
for (i = 0; i < 3; ++i) {