]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iommu: Drop the of_iommu_{set/get}_ops() interface
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 3 Jan 2017 17:34:56 +0000 (17:34 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 26 Jan 2017 18:16:57 +0000 (18:16 +0000)
With the introduction of the new iommu_{register/get}_instance()
interface in commit e4f10ffe4c9b ("iommu: Make of_iommu_set/get_ops() DT
agnostic") (based on struct fwnode_handle as look-up token, so firmware
agnostic) to register IOMMU instances with the core IOMMU layer there is
no reason to keep the old OF based interface around any longer.

Convert all the IOMMU drivers (and OF IOMMU core code) that rely on the
of_iommu_{set/get}_ops() to the new kernel interface to register/retrieve
IOMMU instances and remove the of_iommu_{set/get}_ops() remaining glue
code in order to complete the interface rework.

Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Sricharan R <sricharan@codeaurora.org>
Tested-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/exynos-iommu.c
drivers/iommu/msm_iommu.c
drivers/iommu/mtk_iommu.c
drivers/iommu/of_iommu.c
include/linux/of_iommu.h

index 57ba0d3091ea257a221de36f3143311db3989d63..b79e4c452b8ba69aaa69fdbf37f3f5a530641ac1 100644 (file)
@@ -628,7 +628,7 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
 
        pm_runtime_enable(dev);
 
-       of_iommu_set_ops(dev->of_node, &exynos_iommu_ops);
+       iommu_register_instance(dev->fwnode, &exynos_iommu_ops);
 
        return 0;
 }
index b09692bb5b0a209c321401253a853c652ed374e2..9cd3cee8db4d68c15e4ea4b64e293f7c3933b96b 100644 (file)
@@ -737,7 +737,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
        }
 
        list_add(&iommu->dev_node, &qcom_iommu_devices);
-       of_iommu_set_ops(pdev->dev.of_node, &msm_iommu_ops);
+       iommu_register_instance(pdev->dev.fwnode, &msm_iommu_ops);
 
        pr_info("device mapped at %p, irq %d with %d ctx banks\n",
                iommu->base, iommu->irq, iommu->ncb);
index 1479c76ece9ec31793ec4d0f78a5611d3f09a6cb..0596ab224ff0f5518336fd907c4c011e89c7f1a4 100644 (file)
@@ -655,7 +655,7 @@ static int mtk_iommu_init_fn(struct device_node *np)
                return ret;
        }
 
-       of_iommu_set_ops(np, &mtk_iommu_ops);
+       iommu_register_instance(&np->fwnode, &mtk_iommu_ops);
        return 0;
 }
 
index 0f57ddc4ecc274cbbe2be26618ec9fa90234ea9d..d7f480a52736603f601d18a0f64b4146888e55dd 100644 (file)
@@ -127,7 +127,7 @@ static const struct iommu_ops
                           "iommu-map-mask", &iommu_spec.np, iommu_spec.args))
                return NULL;
 
-       ops = of_iommu_get_ops(iommu_spec.np);
+       ops = iommu_get_instance(&iommu_spec.np->fwnode);
        if (!ops || !ops->of_xlate ||
            iommu_fwspec_init(&pdev->dev, &iommu_spec.np->fwnode, ops) ||
            ops->of_xlate(&pdev->dev, &iommu_spec))
@@ -157,7 +157,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
                                           "#iommu-cells", idx,
                                           &iommu_spec)) {
                np = iommu_spec.np;
-               ops = of_iommu_get_ops(np);
+               ops = iommu_get_instance(&np->fwnode);
 
                if (!ops || !ops->of_xlate ||
                    iommu_fwspec_init(dev, &np->fwnode, ops) ||
index 6a7fc50510999eb330982c3d7b4452cb373063e2..13394ac83c66a70946d5a269ca8014c15477f942 100644 (file)
@@ -31,17 +31,6 @@ static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
 
 #endif /* CONFIG_OF_IOMMU */
 
-static inline void of_iommu_set_ops(struct device_node *np,
-                                   const struct iommu_ops *ops)
-{
-       iommu_register_instance(&np->fwnode, ops);
-}
-
-static inline const struct iommu_ops *of_iommu_get_ops(struct device_node *np)
-{
-       return iommu_get_instance(&np->fwnode);
-}
-
 extern struct of_device_id __iommu_of_table;
 
 typedef int (*of_iommu_init_fn)(struct device_node *);