mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-09 22:24:04 +08:00
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>
This commit is contained in:
parent
7cab8713b1
commit
ef4815ab1f
@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj)
|
|||||||
if (!obj)
|
if (!obj)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (!arch_iommu)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
clk_enable(obj->clk);
|
clk_enable(obj->clk);
|
||||||
|
|
||||||
err = arch_iommu->enable(obj);
|
err = arch_iommu->enable(obj);
|
||||||
|
Loading…
Reference in New Issue
Block a user