iommu/msm: Claim bus ops on probe

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/892d7aaddb24b0d3eaf05534ed29a264d3b52646
Commit:     892d7aaddb24b0d3eaf05534ed29a264d3b52646
Parent:     9ae9df035c274c89b7fe3dbc74cbe2fa63386668
Refname:    refs/heads/master
Author:     Robin Murphy <[email protected]>
AuthorDate: Tue Jan 9 16:17:25 2018 +0000
Committer:  Joerg Roedel <[email protected]>
CommitDate: Wed Jan 17 15:25:49 2018 +0100

    iommu/msm: Claim bus ops on probe
    
    Since the MSM IOMMU driver now probes via DT exclusively rather than
    platform data, dependent masters should be deferred until the IOMMU
    itself is ready. Thus we can do away with the early initialisation
    hook to unconditionally claim the bus ops, and instead do that only
    once an IOMMU is actually probed. Furthermore, this should also make
    the driver safe for multiplatform kernels on non-MSM SoCs.
    
    Reviewed-by: Sricharan R <[email protected]>
    Signed-off-by: Robin Murphy <[email protected]>
    Signed-off-by: Joerg Roedel <[email protected]>
---
 drivers/iommu/msm_iommu.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index 04f4d51ffacb..dda1ce87a070 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -823,6 +823,8 @@ static int msm_iommu_probe(struct platform_device *pdev)
 		goto fail;
 	}
 
+	bus_set_iommu(&platform_bus_type, &msm_iommu_ops);
+
 	pr_info("device mapped at %p, irq %d with %d ctx banks\n",
 		iommu->base, iommu->irq, iommu->ncb);
 
@@ -875,19 +877,7 @@ static void __exit msm_iommu_driver_exit(void)
 subsys_initcall(msm_iommu_driver_init);
 module_exit(msm_iommu_driver_exit);
 
-static int __init msm_iommu_init(void)
-{
-	bus_set_iommu(&platform_bus_type, &msm_iommu_ops);
-	return 0;
-}
-
-static int __init msm_iommu_of_setup(struct device_node *np)
-{
-	msm_iommu_init();
-	return 0;
-}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.