]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: OMAP4: Use WARN_ON() instead of BUG_ON() with graceful exit
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Thu, 3 Mar 2011 12:06:52 +0000 (17:36 +0530)
committerKevin Hilman <khilman@ti.com>
Thu, 8 Dec 2011 19:28:59 +0000 (11:28 -0800)
OMAP4 L2X0 initialisation code uses BUG_ON() for the ioremap()
failure scenarios.

Use WARN_ON() instead and allow graceful function exits.

This was suggsted by Kevin Hilman <khilman@ti.com> during
OMAP4 PM code review.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/omap4-common.c

index beecfdd56ea31c7d2621474475be046a2b3551a3..21d4821c9612c8fb8f6da42ffc798baf71c83fc4 100644 (file)
@@ -72,7 +72,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 -ENOMEM;
 
        /*
         * 16-way associativity, parity disabled