aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r--arch/powerpc/kernel/pci_64.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index f73a16e9867a..fc60a773af7d 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -1365,16 +1365,17 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
1365 1365
1366#endif /* CONFIG_PPC_MULTIPLATFORM */ 1366#endif /* CONFIG_PPC_MULTIPLATFORM */
1367 1367
1368unsigned int pci_address_to_pio(phys_addr_t address) 1368unsigned long pci_address_to_pio(phys_addr_t address)
1369{ 1369{
1370 struct pci_controller *hose, *tmp; 1370 struct pci_controller *hose, *tmp;
1371 1371
1372 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { 1372 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
1373 if (address >= hose->io_base_phys && 1373 if (address >= hose->io_base_phys &&
1374 address < (hose->io_base_phys + hose->pci_io_size)) 1374 address < (hose->io_base_phys + hose->pci_io_size)) {
1375 return (unsigned int) 1375 unsigned long base =
1376 ((unsigned long)hose->io_base_virt + 1376 (unsigned long)hose->io_base_virt - pci_io_base;
1377 (address - hose->io_base_phys)); 1377 return base + (address - hose->io_base_phys);
1378 }
1378 } 1379 }
1379 return (unsigned int)-1; 1380 return (unsigned int)-1;
1380} 1381}