Skip to content

Commit b0c560f

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu: Clean up of_iommu_init_fn
Now that no more drivers rely on arbitrary early initialisation via an of_iommu_init_fn hook, let's clean up the redundant remnants. The IOMMU_OF_DECLARE() macro needs to remain for now, as the probe-deferral mechanism has no other nice way to detect built-in drivers before they have registered themselves, such that it can make the right decision. Reviewed-by: Sricharan R <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent e7747d8 commit b0c560f

File tree

8 files changed

+13
-32
lines changed

8 files changed

+13
-32
lines changed

drivers/iommu/arm-smmu-v3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2962,7 +2962,7 @@ static struct platform_driver arm_smmu_driver = {
29622962
};
29632963
module_platform_driver(arm_smmu_driver);
29642964

2965-
IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3", NULL);
2965+
IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3");
29662966

29672967
MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
29682968
MODULE_AUTHOR("Will Deacon <[email protected]>");

drivers/iommu/arm-smmu.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,12 +2211,12 @@ static struct platform_driver arm_smmu_driver = {
22112211
};
22122212
module_platform_driver(arm_smmu_driver);
22132213

2214-
IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1", NULL);
2215-
IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2", NULL);
2216-
IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400", NULL);
2217-
IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401", NULL);
2218-
IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500", NULL);
2219-
IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2", NULL);
2214+
IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1");
2215+
IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2");
2216+
IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400");
2217+
IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401");
2218+
IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500");
2219+
IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2");
22202220

22212221
MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
22222222
MODULE_AUTHOR("Will Deacon <[email protected]>");

drivers/iommu/exynos-iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,4 +1394,4 @@ static int __init exynos_iommu_init(void)
13941394
}
13951395
core_initcall(exynos_iommu_init);
13961396

1397-
IOMMU_OF_DECLARE(exynos_iommu_of, "samsung,exynos-sysmmu", NULL);
1397+
IOMMU_OF_DECLARE(exynos_iommu_of, "samsung,exynos-sysmmu");

drivers/iommu/ipmmu-vmsa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,8 @@ static void __exit ipmmu_exit(void)
11081108
subsys_initcall(ipmmu_init);
11091109
module_exit(ipmmu_exit);
11101110

1111-
IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "renesas,ipmmu-vmsa", NULL);
1112-
IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", NULL);
1111+
IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "renesas,ipmmu-vmsa");
1112+
IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795");
11131113

11141114
MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU");
11151115
MODULE_AUTHOR("Laurent Pinchart <[email protected]>");

drivers/iommu/msm_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ static void __exit msm_iommu_driver_exit(void)
877877
subsys_initcall(msm_iommu_driver_init);
878878
module_exit(msm_iommu_driver_exit);
879879

880-
IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu", NULL);
880+
IOMMU_OF_DECLARE(msm_iommu_of, "qcom,apq8064-iommu");
881881

882882
MODULE_LICENSE("GPL v2");
883883
MODULE_AUTHOR("Stepan Moskovchenko <[email protected]>");

drivers/iommu/of_iommu.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -231,19 +231,3 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
231231

232232
return ops;
233233
}
234-
235-
static int __init of_iommu_init(void)
236-
{
237-
struct device_node *np;
238-
const struct of_device_id *match, *matches = &__iommu_of_table;
239-
240-
for_each_matching_node_and_match(np, matches, &match) {
241-
const of_iommu_init_fn init_fn = match->data;
242-
243-
if (init_fn && init_fn(np))
244-
pr_err("Failed to initialise IOMMU %pOF\n", np);
245-
}
246-
247-
return 0;
248-
}
249-
postcore_initcall_sync(of_iommu_init);

drivers/iommu/qcom_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ static void __exit qcom_iommu_exit(void)
947947
module_init(qcom_iommu_init);
948948
module_exit(qcom_iommu_exit);
949949

950-
IOMMU_OF_DECLARE(qcom_iommu_dev, "qcom,msm-iommu-v1", NULL);
950+
IOMMU_OF_DECLARE(qcom_iommu_dev, "qcom,msm-iommu-v1");
951951

952952
MODULE_DESCRIPTION("IOMMU API for QCOM IOMMU v1 implementations");
953953
MODULE_LICENSE("GPL v2");

include/linux/of_iommu.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
3434

3535
extern struct of_device_id __iommu_of_table;
3636

37-
typedef int (*of_iommu_init_fn)(struct device_node *);
38-
39-
#define IOMMU_OF_DECLARE(name, compat, fn) \
40-
_OF_DECLARE(iommu, name, compat, fn, of_iommu_init_fn)
37+
#define IOMMU_OF_DECLARE(name, compat) OF_DECLARE_1(iommu, name, compat, NULL)
4138

4239
#endif /* __OF_IOMMU_H */

0 commit comments

Comments
 (0)