Thread (81 messages) flat view 81 messages, 11 authors, 2011-09-20
STALE5441d

[PATCH 05/25] OMAP4: Use WARN_ON() instead of BUG_ON() with graceful exit

From: Santosh <hidden>
Date: 2011-09-05 10:42:02
Also in: linux-omap

On Monday 05 September 2011 03:41 PM, Sergei Shtylyov wrote:
Hello.

On 04-09-2011 17:54, Santosh Shilimkar wrote:
quoted
OMAP4 L2X0 initialisation code uses BUG_ON() for the ioremap()
failure scenarios.
quoted
Use WARN_ON() instead and allow graceful function exits.
quoted
This was suggsted by Kevin Hilman[off-list ref] during
OMAP4 PM code review.
quoted
Signed-off-by: Santosh Shilimkar<redacted>
Cc: Kevin Hilman<redacted>
---
arch/arm/mach-omap2/omap4-common.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
quoted
diff --git a/arch/arm/mach-omap2/omap4-common.c
b/arch/arm/mach-omap2/omap4-common.c
index 4791370..4904025 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -121,7 +121,8 @@ static int __init omap_l2_cache_init(void)
/* Static mapping, never released */
l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
- BUG_ON(!l2cache_base);
+ if (WARN_ON(!l2cache_base))
+ return -ENODEV;
Rather ENOMEM...
Nope. Even though it's related to memory, it's
a memory controller so DEV is right.

Regards
Santosh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help