diff options
| author | Thierry Reding <treding@nvidia.com> | 2014-11-07 15:26:18 +0000 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:12:14 -0700 |
| commit | a80227994b8ea0dbbd6402917a0907ae36383eaa (patch) | |
| tree | e400571ef81bfc1615b34c8a1bd1ded856c3d451 | |
| parent | 36fe32f4eeab086bd4c7bf604f560067a2d68384 (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.
Change-Id: I345b0e922ae3d0d71622217fd869747d25ae2bb4
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: 0e7d37adbe45404a76d05d4ef11544f23cf639dd
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
| -rw-r--r-- | drivers/iommu/arm-smmu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 973054fad39a..0a8952f77536 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2798,8 +2798,20 @@ static struct platform_driver arm_smmu_driver = { static int __init arm_smmu_init(void) { + struct device_node *np; int ret; + /* + * Play nice with systems that don't have an ARM SMMU by checking that + * an ARM SMMU exists in the system before proceeding with the driver + * and IOMMU bus operation registration. + */ + np = of_find_matching_node(NULL, arm_smmu_of_match); + if (!np) + return 0; + + of_node_put(np); + ret = platform_driver_register(&arm_smmu_driver); if (ret) return ret; |
