diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2006-05-19 02:48:47 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-05-24 02:08:56 -0400 |
commit | 96ff6afaf1c2fdd118139095dea66c0910379780 (patch) | |
tree | 5364530523d40789b549edc66e02e47b04932c9a | |
parent | 0d177df15d12926dc2ef7c814f317f02de52ce17 (diff) |
[PATCH] powerpc: remove iSeries_Global_Device_List
We can now scan the list of device nodes instead. This also allows us
to remove the Device_list member of struct pci_dn.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/iseries/iommu.c | 15 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/pci.c | 14 | ||||
-rw-r--r-- | include/asm-powerpc/pci-bridge.h | 1 |
3 files changed, 15 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c index 3ac22065c424..75a5a1e8abb8 100644 --- a/arch/powerpc/platforms/iseries/iommu.c +++ b/arch/powerpc/platforms/iseries/iommu.c | |||
@@ -32,13 +32,11 @@ | |||
32 | #include <asm/tce.h> | 32 | #include <asm/tce.h> |
33 | #include <asm/machdep.h> | 33 | #include <asm/machdep.h> |
34 | #include <asm/abs_addr.h> | 34 | #include <asm/abs_addr.h> |
35 | #include <asm/prom.h> | ||
35 | #include <asm/pci-bridge.h> | 36 | #include <asm/pci-bridge.h> |
36 | #include <asm/iseries/hv_call_xm.h> | 37 | #include <asm/iseries/hv_call_xm.h> |
37 | #include <asm/iseries/iommu.h> | 38 | #include <asm/iseries/iommu.h> |
38 | 39 | ||
39 | extern struct list_head iSeries_Global_Device_List; | ||
40 | |||
41 | |||
42 | static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages, | 40 | static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages, |
43 | unsigned long uaddr, enum dma_data_direction direction) | 41 | unsigned long uaddr, enum dma_data_direction direction) |
44 | { | 42 | { |
@@ -140,10 +138,15 @@ void iommu_table_getparms_iSeries(unsigned long busno, | |||
140 | */ | 138 | */ |
141 | static struct iommu_table *iommu_table_find(struct iommu_table * tbl) | 139 | static struct iommu_table *iommu_table_find(struct iommu_table * tbl) |
142 | { | 140 | { |
143 | struct pci_dn *pdn; | 141 | struct device_node *node; |
142 | |||
143 | for (node = NULL; (node = of_find_all_nodes(node)); ) { | ||
144 | struct pci_dn *pdn = PCI_DN(node); | ||
145 | struct iommu_table *it; | ||
144 | 146 | ||
145 | list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) { | 147 | if (pdn == NULL) |
146 | struct iommu_table *it = pdn->iommu_table; | 148 | continue; |
149 | it = pdn->iommu_table; | ||
147 | if ((it != NULL) && | 150 | if ((it != NULL) && |
148 | (it->it_type == TCE_PCI) && | 151 | (it->it_type == TCE_PCI) && |
149 | (it->it_offset == tbl->it_offset) && | 152 | (it->it_offset == tbl->it_offset) && |
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 9d571e749098..5bc08d4eef49 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -50,8 +50,6 @@ | |||
50 | */ | 50 | */ |
51 | static struct device_node *find_Device_Node(int bus, int devfn); | 51 | static struct device_node *find_Device_Node(int bus, int devfn); |
52 | 52 | ||
53 | LIST_HEAD(iSeries_Global_Device_List); | ||
54 | |||
55 | static int Pci_Retry_Max = 3; /* Only retry 3 times */ | 53 | static int Pci_Retry_Max = 3; /* Only retry 3 times */ |
56 | static int Pci_Error_Flag = 1; /* Set Retry Error on. */ | 54 | static int Pci_Error_Flag = 1; /* Set Retry Error on. */ |
57 | 55 | ||
@@ -245,8 +243,6 @@ void iSeries_pcibios_init(void) | |||
245 | pdn->bussubno = *busp; | 243 | pdn->bussubno = *busp; |
246 | pdn->Irq = irq; | 244 | pdn->Irq = irq; |
247 | pdn->LogicalSlot = *lsn; | 245 | pdn->LogicalSlot = *lsn; |
248 | list_add_tail(&pdn->Device_List, | ||
249 | &iSeries_Global_Device_List); | ||
250 | } | 246 | } |
251 | } | 247 | } |
252 | } | 248 | } |
@@ -338,11 +334,13 @@ EXPORT_SYMBOL(iSeries_memcpy_fromio); | |||
338 | */ | 334 | */ |
339 | static struct device_node *find_Device_Node(int bus, int devfn) | 335 | static struct device_node *find_Device_Node(int bus, int devfn) |
340 | { | 336 | { |
341 | struct pci_dn *pdn; | 337 | struct device_node *node; |
338 | |||
339 | for (node = NULL; (node = of_find_all_nodes(node)); ) { | ||
340 | struct pci_dn *pdn = PCI_DN(node); | ||
342 | 341 | ||
343 | list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) { | 342 | if (pdn && (bus == pdn->busno) && (devfn == pdn->devfn)) |
344 | if ((bus == pdn->busno) && (devfn == pdn->devfn)) | 343 | return node; |
345 | return pdn->node; | ||
346 | } | 344 | } |
347 | return NULL; | 345 | return NULL; |
348 | } | 346 | } |
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index 38de92d41a14..59794b466efc 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
@@ -79,7 +79,6 @@ struct pci_dn { | |||
79 | struct pci_dev *pcidev; /* back-pointer to the pci device */ | 79 | struct pci_dev *pcidev; /* back-pointer to the pci device */ |
80 | struct device_node *node; /* back-pointer to the device_node */ | 80 | struct device_node *node; /* back-pointer to the device_node */ |
81 | #ifdef CONFIG_PPC_ISERIES | 81 | #ifdef CONFIG_PPC_ISERIES |
82 | struct list_head Device_List; | ||
83 | int Irq; /* Assigned IRQ */ | 82 | int Irq; /* Assigned IRQ */ |
84 | int Flags; /* Possible flags(disable/bist)*/ | 83 | int Flags; /* Possible flags(disable/bist)*/ |
85 | u8 LogicalSlot; /* Hv Slot Index for Tces */ | 84 | u8 LogicalSlot; /* Hv Slot Index for Tces */ |