OMAP2/3: GPMC: ensure valid clock pointer
authorKevin Hilman <khilman@deeprootsystems.com>
Fri, 29 Jan 2010 22:20:06 +0000 (14:20 -0800)
committerTony Lindgren <tony@atomide.com>
Wed, 3 Feb 2010 16:48:06 +0000 (08:48 -0800)
Ensure valid clock pointer during GPMC init.  Fixes compiler
warning about potential use of uninitialized variable.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/gpmc.c

index 3f1334f..7027cdc 100644 (file)
@@ -505,7 +505,7 @@ static void __init gpmc_mem_init(void)
 void __init gpmc_init(void)
 {
        u32 l;
-       char *ck;
+       char *ck = NULL;
 
        if (cpu_is_omap24xx()) {
                ck = "core_l3_ck";
@@ -521,6 +521,9 @@ void __init gpmc_init(void)
                l = OMAP44XX_GPMC_BASE;
        }
 
+       if (WARN_ON(!ck))
+               return;
+
        gpmc_l3_clk = clk_get(NULL, ck);
        if (IS_ERR(gpmc_l3_clk)) {
                printk(KERN_ERR "Could not get GPMC clock %s\n", ck);