diff options
author | Martin Hostettler <martin@neutronstar.dyndns.org> | 2011-02-24 15:51:31 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-02-24 15:51:31 -0500 |
commit | ef4815ab1ff10d642c21ef92faa6544934bc78d1 (patch) | |
tree | a1eb3c43e281203282f6b0dc193aa07082357df0 | |
parent | 7cab8713b1ed0dab08ad6458f92a40b7ff4be619 (diff) |
omap: iommu: Gracefully fail iommu_enable if no arch_iommu is registered
In a modular build of the iommu code it's possible that the arch iommu code
isn't loaded when trying to enable the iommu. Instead of blindly following a
null pointer return -NODEV in that case.
Signed-off-by: Martin Hostettler <martin@neutronstar.dyndns.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/plat-omap/iommu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index b1107c08da56..3d8f55ea8666 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
@@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj) | |||
104 | if (!obj) | 104 | if (!obj) |
105 | return -EINVAL; | 105 | return -EINVAL; |
106 | 106 | ||
107 | if (!arch_iommu) | ||
108 | return -ENODEV; | ||
109 | |||
107 | clk_enable(obj->clk); | 110 | clk_enable(obj->clk); |
108 | 111 | ||
109 | err = arch_iommu->enable(obj); | 112 | err = arch_iommu->enable(obj); |