Skip to content

Commit

Permalink
omap: iommu: Gracefully fail iommu_enable if no arch_iommu is registered
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Hostettler authored and Tony Lindgren committed Feb 24, 2011
1 parent 7cab871 commit ef4815a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm/plat-omap/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj)
if (!obj)
return -EINVAL;

if (!arch_iommu)
return -ENODEV;

clk_enable(obj->clk);

err = arch_iommu->enable(obj);
Expand Down

0 comments on commit ef4815a

Please sign in to comment.