From 5516b540e98de6f7474a4e7149470ad6a0bbc54a Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 27 Jun 2007 01:17:57 -0500 Subject: [POWERPC] Use global_number in ppc32 pci_controller Make the pci_controller struct use global_number for the PHB domain number instead of index to match what ppc64 does and reuse its pci_domain_nr code. Introduced a pci-common.c to handle shared code between ppc32 & ppc64. Signed-off-by: Kumar Gala --- include/asm-powerpc/pci-bridge.h | 2 +- include/asm-powerpc/pci.h | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index e2b2b6b7b6b8..80cfb4a75053 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h @@ -21,7 +21,6 @@ extern struct pci_controller* pci_bus_to_hose(int bus); struct pci_controller { struct pci_bus *bus; void *arch_data; - int index; /* PCI domain number */ struct pci_controller *next; struct device *parent; @@ -60,6 +59,7 @@ struct pci_controller { */ struct resource io_resource; struct resource mem_resources[3]; + int global_number; /* PCI domain number */ }; static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h index 93e3752df6b7..0cd3e77efd20 100644 --- a/include/asm-powerpc/pci.h +++ b/include/asm-powerpc/pci.h @@ -107,8 +107,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, #define get_pci_dma_ops() NULL #endif -extern int pci_domain_nr(struct pci_bus *bus); - /* Decide whether to display the domain number in /proc */ extern int pci_proc_domain(struct pci_bus *bus); @@ -130,9 +128,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, */ #define pci_dac_dma_supported(pci_dev, mask) (0) -/* Return the index of the PCI controller for device PDEV. */ -#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index - /* Set the name of the bus as it appears in /proc/bus/pci */ static inline int pci_proc_domain(struct pci_bus *bus) { @@ -141,6 +136,8 @@ static inline int pci_proc_domain(struct pci_bus *bus) #endif /* CONFIG_PPC64 */ +extern int pci_domain_nr(struct pci_bus *bus); + struct vm_area_struct; /* Map a range of PCI memory or I/O space for a device into user space */ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, -- cgit v1.2.3-59-g8ed1b