public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] omap iommu: Gracefully fail iommu_enable if no arch_iommu is registered.
@ 2011-01-18 21:45 Martin Hostettler
  2011-02-17 21:45 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Hostettler @ 2011-01-18 21:45 UTC (permalink / raw)
  To: linux-omap, Tony Lindgren; +Cc: Hiroshi DOYU, Martin Hostettler

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>
---
 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 6cd151b..c1c6887 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)
 	if (!obj)
 		return -EINVAL;
 
+	if (!arch_iommu)
+		return -ENODEV;
+
 	clk_enable(obj->clk);
 
 	err = arch_iommu->enable(obj);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] omap iommu: Gracefully fail iommu_enable if no arch_iommu is registered.
  2011-01-18 21:45 [PATCH] omap iommu: Gracefully fail iommu_enable if no arch_iommu is registered Martin Hostettler
@ 2011-02-17 21:45 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2011-02-17 21:45 UTC (permalink / raw)
  To: Martin Hostettler; +Cc: linux-omap, Hiroshi DOYU

* Martin Hostettler <martin@neutronstar.dyndns.org> [110118 13:44]:
> 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.

Thanks applying.

Tony

 
> Signed-off-by: Martin Hostettler <martin@neutronstar.dyndns.org>
> ---
>  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 6cd151b..c1c6887 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)
>  	if (!obj)
>  		return -EINVAL;
>  
> +	if (!arch_iommu)
> +		return -ENODEV;
> +
>  	clk_enable(obj->clk);
>  
>  	err = arch_iommu->enable(obj);
> -- 
> 1.7.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-17 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-18 21:45 [PATCH] omap iommu: Gracefully fail iommu_enable if no arch_iommu is registered Martin Hostettler
2011-02-17 21:45 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox