aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-01-11 01:43:55 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-11 01:43:55 -0800
commit0ca63a2ac3a68acd98b2af1bf1972a61bfcfa63f (patch)
tree3ea0825241da2fbff1a43963940b03a9402fc65d /arch
parent984892281e014de2f17ca0dd047728dd7634a885 (diff)
downloadhistory-0ca63a2ac3a68acd98b2af1bf1972a61bfcfa63f.tar.gz
[PATCH] ppc64: PCI cleanup
- remove pci_fix_bus_sysdata. We required it for the old pci dma subsystem, but now it is useless. - remove PCI_GET_PHB_PTR and use pci_bus_to_host instead - remove pci_find_hose_for_OF_device - remove some unused fields in struct pci_controller - remove pci_device_loc stale prototype - remove an old mask of pci bus number that was left around from the pre PCI domains days Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc64/kernel/maple_pci.c3
-rw-r--r--arch/ppc64/kernel/pSeries_pci.c1
-rw-r--r--arch/ppc64/kernel/pci.c33
-rw-r--r--arch/ppc64/kernel/pci.h4
-rw-r--r--arch/ppc64/kernel/pci_dn.c33
-rw-r--r--arch/ppc64/kernel/pmac_pci.c2
6 files changed, 8 insertions, 68 deletions
diff --git a/arch/ppc64/kernel/maple_pci.c b/arch/ppc64/kernel/maple_pci.c
index f8cd5b495d6b0b..53993999b265ac 100644
--- a/arch/ppc64/kernel/maple_pci.c
+++ b/arch/ppc64/kernel/maple_pci.c
@@ -382,9 +382,6 @@ void __init maple_pcibios_fixup(void)
/* Do the mapping of the IO space */
phbs_remap_io();
- /* Fixup the pci_bus sysdata pointers */
- pci_fix_bus_sysdata();
-
DBG(" <- maple_pcibios_fixup\n");
}
diff --git a/arch/ppc64/kernel/pSeries_pci.c b/arch/ppc64/kernel/pSeries_pci.c
index 2b9a00951f2070..8953e94889bab4 100644
--- a/arch/ppc64/kernel/pSeries_pci.c
+++ b/arch/ppc64/kernel/pSeries_pci.c
@@ -552,7 +552,6 @@ void __init pSeries_final_fixup(void)
phbs_remap_io();
pSeries_request_regions();
- pci_fix_bus_sysdata();
pci_addr_cache_build();
}
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index 25822272542e30..a7bf62655601b8 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -91,7 +91,7 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region
struct resource *res)
{
unsigned long offset = 0;
- struct pci_controller *hose = PCI_GET_PHB_PTR(dev);
+ struct pci_controller *hose = pci_bus_to_host(dev->bus);
if (!hose)
return;
@@ -127,7 +127,7 @@ void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align)
{
struct pci_dev *dev = data;
- struct pci_controller *hose = PCI_GET_PHB_PTR(dev);
+ struct pci_controller *hose = pci_bus_to_host(dev->bus);
unsigned long start = res->start;
unsigned long alignto;
@@ -292,7 +292,7 @@ int pci_domain_nr(struct pci_bus *bus)
#ifdef CONFIG_PPC_ISERIES
return 0;
#else
- struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
+ struct pci_controller *hose = pci_bus_to_host(bus);
return hose->global_number;
#endif
@@ -304,7 +304,7 @@ EXPORT_SYMBOL(pci_domain_nr);
int pci_name_bus(char *name, struct pci_bus *bus)
{
#ifndef CONFIG_PPC_ISERIES
- struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
+ struct pci_controller *hose = pci_bus_to_host(bus);
if (hose->buid)
sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
@@ -336,7 +336,7 @@ static __inline__ int __pci_mmap_make_offset(struct pci_dev *dev,
struct vm_area_struct *vma,
enum pci_mmap_state mmap_state)
{
- struct pci_controller *hose = PCI_GET_PHB_PTR(dev);
+ struct pci_controller *hose = pci_bus_to_host(dev->bus);
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
unsigned long io_offset = 0;
int i, res_bit;
@@ -643,7 +643,7 @@ void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose)
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_GET_PHB_PTR(bus);
+ struct pci_controller *hose = pci_bus_to_host(bus);
struct pci_bus_region region;
struct resource *res;
@@ -728,23 +728,6 @@ void phbs_remap_io(void)
remap_bus_range(hose->bus);
}
-
-/*
- * This function finds the PHB that matching device_node in the
- * OpenFirmware by scanning all the pci_controllers.
- */
-struct pci_controller* pci_find_hose_for_OF_device(struct device_node *node)
-{
- while (node) {
- struct pci_controller *hose, *tmp;
- list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
- if (hose->arch_data == node)
- return hose;
- node=node->parent;
- }
- return NULL;
-}
-
/*
* ppc64 can have multifunction devices that do not respond to function 0.
* In this case we must scan all functions.
@@ -778,7 +761,7 @@ void __devinit pcibios_fixup_device_resources(struct pci_dev *dev,
struct pci_bus *bus)
{
/* Update device resources. */
- struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
+ struct pci_controller *hose = pci_bus_to_host(bus);
int i;
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
@@ -814,7 +797,7 @@ EXPORT_SYMBOL(pcibios_fixup_device_resources);
void __devinit pcibios_fixup_bus(struct pci_bus *bus)
{
- struct pci_controller *hose = PCI_GET_PHB_PTR(bus);
+ struct pci_controller *hose = pci_bus_to_host(bus);
struct pci_dev *dev = bus->self;
struct resource *res;
int i;
diff --git a/arch/ppc64/kernel/pci.h b/arch/ppc64/kernel/pci.h
index 2ed6b674bbca21..28517c14015b92 100644
--- a/arch/ppc64/kernel/pci.h
+++ b/arch/ppc64/kernel/pci.h
@@ -17,7 +17,6 @@ extern unsigned long isa_io_base;
extern void pci_setup_pci_controller(struct pci_controller *hose);
extern void pci_setup_phb_io(struct pci_controller *hose, int primary);
-extern struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node);
extern void pci_setup_phb_io_dynamic(struct pci_controller *hose);
@@ -36,11 +35,8 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
void pci_devs_phb_init(void);
void pci_devs_phb_init_dynamic(struct pci_controller *phb);
-void pci_fix_bus_sysdata(void);
struct device_node *fetch_dev_dn(struct pci_dev *dev);
-#define PCI_GET_PHB_PTR(dev) (((struct device_node *)(dev)->sysdata)->phb)
-
/* PCI address cache management routines */
void pci_addr_cache_insert_device(struct pci_dev *dev);
void pci_addr_cache_remove_device(struct pci_dev *dev);
diff --git a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c
index 962394708ece6e..280b744fe64e3a 100644
--- a/arch/ppc64/kernel/pci_dn.c
+++ b/arch/ppc64/kernel/pci_dn.c
@@ -21,19 +21,12 @@
*/
#include <linux/kernel.h>
#include <linux/pci.h>
-#include <linux/delay.h>
#include <linux/string.h>
#include <linux/init.h>
-#include <linux/bootmem.h>
#include <asm/io.h>
-#include <asm/pgtable.h>
-#include <asm/irq.h>
#include <asm/prom.h>
-#include <asm/machdep.h>
#include <asm/pci-bridge.h>
-#include <asm/ppcdebug.h>
-#include <asm/iommu.h>
#include "pci.h"
@@ -178,29 +171,3 @@ void __init pci_devs_phb_init(void)
list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
pci_devs_phb_init_dynamic(phb);
}
-
-
-static void __init pci_fixup_bus_sysdata_list(struct list_head *bus_list)
-{
- struct pci_bus *bus;
-
- list_for_each_entry(bus, bus_list, node) {
- if (bus->self)
- bus->sysdata = bus->self->sysdata;
- pci_fixup_bus_sysdata_list(&bus->children);
- }
-}
-
-/*
- * Fixup the bus->sysdata ptrs to point to the bus' device_node.
- * This is done late in pcibios_init(). We do this mostly for
- * sanity, but pci_dma.c uses these at DMA time so they must be
- * correct.
- * To do this we recurse down the bus hierarchy. Note that PHB's
- * have bus->self == NULL, but fortunately bus->sysdata is already
- * correct in this case.
- */
-void __init pci_fix_bus_sysdata(void)
-{
- pci_fixup_bus_sysdata_list(&pci_root_buses);
-}
diff --git a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c
index 32634216ad78f6..00a831df6d9f10 100644
--- a/arch/ppc64/kernel/pmac_pci.c
+++ b/arch/ppc64/kernel/pmac_pci.c
@@ -664,8 +664,6 @@ void __init pmac_pcibios_fixup(void)
for_each_pci_dev(dev)
pci_read_irq_line(dev);
-
- pci_fix_bus_sysdata();
}
static void __init pmac_fixup_phb_resources(void)