From c8890d42bcb3cc47ce5dd98fd374c5fba697f657 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Wed, 9 May 2007 21:47:15 +1000 Subject: [PATCH] --- yaml --- r: 55855 b: refs/heads/master c: 31e92e0a1f40ecbef415cd99dc886b14963dc594 h: refs/heads/master i: 55853: 472548e801d75609cc85b778ac44e51dac4db5e3 55851: 3b297de6471122809dc8fe1f0f17a12b4f64d174 55847: 8d1a71c406a4cbaeacbd862fc1496518b934d2a9 55839: 8be746fccc71c4639bcd6bdf4f05fabf1105c883 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/pci_64.c | 37 +++++++++++------------------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/[refs] b/[refs] index 8112f01bdfe2..20036ab1ff79 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4cc81aac8bd2022d5365ad23b7ce6406676e0aa8 +refs/heads/master: 31e92e0a1f40ecbef415cd99dc886b14963dc594 diff --git a/trunk/arch/powerpc/kernel/pci_64.c b/trunk/arch/powerpc/kernel/pci_64.c index 6d05a1f377b5..b0409e19b1c1 100644 --- a/trunk/arch/powerpc/kernel/pci_64.c +++ b/trunk/arch/powerpc/kernel/pci_64.c @@ -1098,35 +1098,24 @@ static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys, unsigned long *start_virt, unsigned long *size) { struct pci_controller *hose = pci_bus_to_host(bus); - struct pci_bus_region region; struct resource *res; - if (bus->self) { + if (bus->self) res = bus->resource[0]; - pcibios_resource_to_bus(bus->self, ®ion, res); - *start_phys = hose->io_base_phys + region.start; - *start_virt = (unsigned long) hose->io_base_virt + - region.start; - if (region.end > region.start) - *size = region.end - region.start + 1; - else { - printk("%s(): unexpected region 0x%lx->0x%lx\n", - __FUNCTION__, region.start, region.end); - return 1; - } - - } else { + else /* Root Bus */ res = &hose->io_resource; - *start_phys = hose->io_base_phys + res->start; - *start_virt = (unsigned long) hose->io_base_virt + res->start; - if (res->end > res->start) - *size = res->end - res->start + 1; - else { - printk("%s(): unexpected region 0x%lx->0x%lx\n", - __FUNCTION__, res->start, res->end); - return 1; - } + + *start_virt = pci_io_base + res->start; + *start_phys = *start_virt + hose->io_base_phys + - (unsigned long) hose->io_base_virt; + + if (res->end > res->start) + *size = res->end - res->start + 1; + else { + printk("%s(): unexpected region 0x%lx->0x%lx\n", + __FUNCTION__, res->start, res->end); + return 1; } return 0;