Merge tag 'iommu-updates-v3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro...
[firefly-linux-kernel-4.4.55.git] / drivers / iommu / tegra-smmu.c
index c0f7a42662635a288fc8c98fabe3d8f1b35f1141..25c1210c0832b05fc36033969573af27c39e25cc 100644 (file)
 #include <linux/of_iommu.h>
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
+#include <linux/tegra-ahb.h>
 
 #include <asm/page.h>
 #include <asm/cacheflush.h>
 
-#include <mach/iomap.h>
-#include <mach/tegra-ahb.h>
-
 enum smmu_hwgrp {
        HWGRP_AFI,
        HWGRP_AVPC,
@@ -696,10 +694,8 @@ static void __smmu_iommu_unmap(struct smmu_as *as, dma_addr_t iova)
        *pte = _PTE_VACANT(iova);
        FLUSH_CPU_DCACHE(pte, page, sizeof(*pte));
        flush_ptc_and_tlb(as->smmu, as, iova, pte, page, 0);
-       if (!--(*count)) {
+       if (!--(*count))
                free_ptbl(as, iova);
-               smmu_flush_regs(as->smmu, 0);
-       }
 }
 
 static void __smmu_iommu_map_pfn(struct smmu_as *as, dma_addr_t iova,
@@ -1234,6 +1230,7 @@ static int tegra_smmu_probe(struct platform_device *pdev)
 
        smmu_debugfs_create(smmu);
        smmu_handle = smmu;
+       bus_set_iommu(&platform_bus_type, &smmu_iommu_ops);
        return 0;
 }
 
@@ -1278,7 +1275,6 @@ static struct platform_driver tegra_smmu_driver = {
 
 static int __devinit tegra_smmu_init(void)
 {
-       bus_set_iommu(&platform_bus_type, &smmu_iommu_ops);
        return platform_driver_register(&tegra_smmu_driver);
 }