Skip to content

Commit 65e251a

Browse files
Lorenzo Pieralisiwildea01
authored andcommitted
iommu: Drop the of_iommu_{set/get}_ops() interface
With the introduction of the new iommu_{register/get}_instance() interface in commit e4f10ff ("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 <[email protected]> Cc: Will Deacon <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Marek Szyprowski <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Tested-by: Sricharan R <[email protected]> Tested-by: Yong Wu <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 692c4e4 commit 65e251a

File tree

5 files changed

+5
-16
lines changed

5 files changed

+5
-16
lines changed

drivers/iommu/exynos-iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
628628

629629
pm_runtime_enable(dev);
630630

631-
of_iommu_set_ops(dev->of_node, &exynos_iommu_ops);
631+
iommu_register_instance(dev->fwnode, &exynos_iommu_ops);
632632

633633
return 0;
634634
}

drivers/iommu/msm_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
737737
}
738738

739739
list_add(&iommu->dev_node, &qcom_iommu_devices);
740-
of_iommu_set_ops(pdev->dev.of_node, &msm_iommu_ops);
740+
iommu_register_instance(pdev->dev.fwnode, &msm_iommu_ops);
741741

742742
pr_info("device mapped at %p, irq %d with %d ctx banks\n",
743743
iommu->base, iommu->irq, iommu->ncb);

drivers/iommu/mtk_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static int mtk_iommu_init_fn(struct device_node *np)
655655
return ret;
656656
}
657657

658-
of_iommu_set_ops(np, &mtk_iommu_ops);
658+
iommu_register_instance(&np->fwnode, &mtk_iommu_ops);
659659
return 0;
660660
}
661661

drivers/iommu/of_iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static const struct iommu_ops
127127
"iommu-map-mask", &iommu_spec.np, iommu_spec.args))
128128
return NULL;
129129

130-
ops = of_iommu_get_ops(iommu_spec.np);
130+
ops = iommu_get_instance(&iommu_spec.np->fwnode);
131131
if (!ops || !ops->of_xlate ||
132132
iommu_fwspec_init(&pdev->dev, &iommu_spec.np->fwnode, ops) ||
133133
ops->of_xlate(&pdev->dev, &iommu_spec))
@@ -157,7 +157,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
157157
"#iommu-cells", idx,
158158
&iommu_spec)) {
159159
np = iommu_spec.np;
160-
ops = of_iommu_get_ops(np);
160+
ops = iommu_get_instance(&np->fwnode);
161161

162162
if (!ops || !ops->of_xlate ||
163163
iommu_fwspec_init(dev, &np->fwnode, ops) ||

include/linux/of_iommu.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
3131

3232
#endif /* CONFIG_OF_IOMMU */
3333

34-
static inline void of_iommu_set_ops(struct device_node *np,
35-
const struct iommu_ops *ops)
36-
{
37-
iommu_register_instance(&np->fwnode, ops);
38-
}
39-
40-
static inline const struct iommu_ops *of_iommu_get_ops(struct device_node *np)
41-
{
42-
return iommu_get_instance(&np->fwnode);
43-
}
44-
4534
extern struct of_device_id __iommu_of_table;
4635

4736
typedef int (*of_iommu_init_fn)(struct device_node *);

0 commit comments

Comments
 (0)