Commit 96188ce5 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras

[POWERPC] pSeries: Remove dependency on pci_dn bussubno

Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 68d315f5
...@@ -296,11 +296,12 @@ static void iommu_table_setparms(struct pci_controller *phb, ...@@ -296,11 +296,12 @@ static void iommu_table_setparms(struct pci_controller *phb,
static void iommu_table_setparms_lpar(struct pci_controller *phb, static void iommu_table_setparms_lpar(struct pci_controller *phb,
struct device_node *dn, struct device_node *dn,
struct iommu_table *tbl, struct iommu_table *tbl,
const void *dma_window) const void *dma_window,
int bussubno)
{ {
unsigned long offset, size; unsigned long offset, size;
tbl->it_busno = PCI_DN(dn)->bussubno; tbl->it_busno = bussubno;
of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size); of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size);
tbl->it_base = 0; tbl->it_base = 0;
...@@ -420,17 +421,10 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus) ...@@ -420,17 +421,10 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
pdn->full_name, ppci->iommu_table); pdn->full_name, ppci->iommu_table);
if (!ppci->iommu_table) { if (!ppci->iommu_table) {
/* Bussubno hasn't been copied yet.
* Do it now because iommu_table_setparms_lpar needs it.
*/
ppci->bussubno = bus->number;
tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
ppci->phb->node); ppci->phb->node);
iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window,
iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window); bus->number);
ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node); ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
DBG(" created table: %p\n", ppci->iommu_table); DBG(" created table: %p\n", ppci->iommu_table);
} }
...@@ -523,14 +517,10 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) ...@@ -523,14 +517,10 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
pci = PCI_DN(pdn); pci = PCI_DN(pdn);
if (!pci->iommu_table) { if (!pci->iommu_table) {
/* iommu_table_setparms_lpar needs bussubno. */
pci->bussubno = pci->phb->bus->number;
tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL, tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
pci->phb->node); pci->phb->node);
iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window,
iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window); pci->phb->bus->number);
pci->iommu_table = iommu_init_table(tbl, pci->phb->node); pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
DBG(" created table: %p\n", pci->iommu_table); DBG(" created table: %p\n", pci->iommu_table);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment