aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-11-07 10:26:18 -0500
committerWill Deacon <will.deacon@arm.com>2014-11-14 09:41:39 -0500
commit0e7d37adbe45404a76d05d4ef11544f23cf639dd (patch)
tree0081582c0738c99ed7f073a967751bdf126887ee
parentcfdeec22e459e3c5081c8fc6d956c8ee68943397 (diff)
iommu/arm-smmu: Play nice on non-ARM/SMMU systems
Currently the driver registers IOMMU bus operations for all busses even if no ARM SMMU is present on a system. Depending on the driver probing order this prevents the driver for the real IOMMU to register itself as the bus-wide IOMMU. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--drivers/iommu/arm-smmu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index c8fc02f111c5..217581469f79 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -2075,8 +2075,20 @@ static struct platform_driver arm_smmu_driver = {
2075 2075
2076static int __init arm_smmu_init(void) 2076static int __init arm_smmu_init(void)
2077{ 2077{
2078 struct device_node *np;
2078 int ret; 2079 int ret;
2079 2080
2081 /*
2082 * Play nice with systems that don't have an ARM SMMU by checking that
2083 * an ARM SMMU exists in the system before proceeding with the driver
2084 * and IOMMU bus operation registration.
2085 */
2086 np = of_find_matching_node(NULL, arm_smmu_of_match);
2087 if (!np)
2088 return 0;
2089
2090 of_node_put(np);
2091
2080 ret = platform_driver_register(&arm_smmu_driver); 2092 ret = platform_driver_register(&arm_smmu_driver);
2081 if (ret) 2093 if (ret)
2082 return ret; 2094 return ret;