summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/ipmmu-vmsa.c
diff options
context:
space:
mode:
authorDmitry Osipenko2018-07-26 23:19:16 +0200
committerJoerg Roedel2018-07-27 09:50:57 +0200
commit5c5c87411488af3cd082221e567498d813d0fe83 (patch)
tree3d44f6ac09eddfdbb69c7dbc62df2a98deb6aac8 /drivers/iommu/ipmmu-vmsa.c
parentiommu/ipmmu-vmsa: Clarify supported platforms (diff)
downloadkernel-qcow2-linux-5c5c87411488af3cd082221e567498d813d0fe83.tar.gz
kernel-qcow2-linux-5c5c87411488af3cd082221e567498d813d0fe83.tar.xz
kernel-qcow2-linux-5c5c87411488af3cd082221e567498d813d0fe83.zip
iommu/ipmmu-vmsa: Don't register as BUS IOMMU if machine doesn't have IPMMU-VMSA
This fixes kernel crashing on NVIDIA Tegra if kernel is compiled in a multiplatform configuration and IPMMU-VMSA driver is enabled. Cc: <stable@vger.kernel.org> # v3.20+ Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/ipmmu-vmsa.c')
-rw-r--r--drivers/iommu/ipmmu-vmsa.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 41eee3401f05..51af2c528a31 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1108,12 +1108,19 @@ static struct platform_driver ipmmu_driver = {
static int __init ipmmu_init(void)
{
+ struct device_node *np;
static bool setup_done;
int ret;
if (setup_done)
return 0;
+ np = of_find_matching_node(NULL, ipmmu_of_ids);
+ if (!np)
+ return 0;
+
+ of_node_put(np);
+
ret = platform_driver_register(&ipmmu_driver);
if (ret < 0)
return ret;