ARM: OMAP2+: powerdomain: pwrdm_for_each_clkdm iterate only valid clkdms
authorNishanth Menon <nm@ti.com>
Sat, 7 Jun 2014 00:36:41 +0000 (19:36 -0500)
committerNishanth Menon <nm@ti.com>
Mon, 8 Sep 2014 16:22:41 +0000 (11:22 -0500)
No need to invoke callback when the clkdm pointer is NULL.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
arch/arm/mach-omap2/powerdomain.c

index faebd5f..f391948 100644 (file)
@@ -546,7 +546,8 @@ int pwrdm_for_each_clkdm(struct powerdomain *pwrdm,
                return -EINVAL;
 
        for (i = 0; i < PWRDM_MAX_CLKDMS && !ret; i++)
-               ret = (*fn)(pwrdm, pwrdm->pwrdm_clkdms[i]);
+               if (pwrdm->pwrdm_clkdms[i])
+                       ret = (*fn)(pwrdm, pwrdm->pwrdm_clkdms[i]);
 
        return ret;
 }