Patchwork [12/15] ppc/dart: iommu table cleanup

login
register
mail settings
Submitter Nishanth Aravamudan
Date Sept. 15, 2010, 6:05 p.m.
Message ID <1284573958-8397-13-git-send-email-nacc@us.ibm.com>
Download mbox | patch
Permalink /patch/64867/
State Superseded
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Nishanth Aravamudan - Sept. 15, 2010, 6:05 p.m.
No need to set the device tree device_node pci node iommu pointer, its
only used for dlpar remove.

direct_dma_ops are the default, no need to restore them or dma bus ops
if we haven't set them in the error paths.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
---
 arch/powerpc/sysdev/dart_iommu.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

Patch

diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 559db2b..64fe9c7 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -302,17 +302,10 @@  static void pci_dma_dev_setup_dart(struct pci_dev *dev)
 
 static void pci_dma_bus_setup_dart(struct pci_bus *bus)
 {
-	struct device_node *dn;
-
 	if (!iommu_table_dart_inited) {
 		iommu_table_dart_inited = 1;
 		iommu_table_dart_setup();
 	}
-
-	dn = pci_bus_to_OF_node(bus);
-
-	if (dn)
-		PCI_DN(dn)->iommu_table = &iommu_table_dart;
 }
 
 void __init iommu_init_early_dart(void)
@@ -324,7 +317,7 @@  void __init iommu_init_early_dart(void)
 	if (dn == NULL) {
 		dn = of_find_compatible_node(NULL, "dart", "u4-dart");
 		if (dn == NULL)
-			goto bail;
+			return;	/* use default direct_dma_ops */
 		dart_is_u4 = 1;
 	}
 
@@ -340,16 +333,7 @@  void __init iommu_init_early_dart(void)
 
 		/* Setup pci_dma ops */
 		set_pci_dma_ops(&dma_iommu_ops);
-		return;
 	}
-
- bail:
-	/* If init failed, use direct iommu and null setup functions */
-	ppc_md.pci_dma_dev_setup = NULL;
-	ppc_md.pci_dma_bus_setup = NULL;
-
-	/* Setup pci_dma ops */
-	set_pci_dma_ops(&dma_direct_ops);
 }
 
 #ifdef CONFIG_PM