diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-06-22 03:27:42 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-06-23 12:57:58 -0400 |
commit | 5c2d0218290afa3c335f38583bf4f8e8adad4c76 (patch) | |
tree | fe190911a4f93c51b00f21d6c606be614597ef90 /drivers/iommu/arm-smmu-v3.c | |
parent | ebdd13c93f8e878afcdba642f48cd1bd85619e2a (diff) |
iommu: arm-smmu: Handle return of iommu_device_register.
iommu_device_register returns an error code and, although it currently
never fails, we should check its return value anyway.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
[will: adjusted to follow arm-smmu.c]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/arm-smmu-v3.c')
-rw-r--r-- | drivers/iommu/arm-smmu-v3.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 0fd09745822f..029fe0cffee7 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c | |||
@@ -2744,6 +2744,10 @@ static int arm_smmu_device_probe(struct platform_device *pdev) | |||
2744 | iommu_device_set_fwnode(&smmu->iommu, dev->fwnode); | 2744 | iommu_device_set_fwnode(&smmu->iommu, dev->fwnode); |
2745 | 2745 | ||
2746 | ret = iommu_device_register(&smmu->iommu); | 2746 | ret = iommu_device_register(&smmu->iommu); |
2747 | if (ret) { | ||
2748 | dev_err(dev, "Failed to register iommu\n"); | ||
2749 | return ret; | ||
2750 | } | ||
2747 | 2751 | ||
2748 | #ifdef CONFIG_PCI | 2752 | #ifdef CONFIG_PCI |
2749 | if (pci_bus_type.iommu_ops != &arm_smmu_ops) { | 2753 | if (pci_bus_type.iommu_ops != &arm_smmu_ops) { |