From 13bbffd4ebca57dfae59a3f13ff98dc417f89b23 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 6 Jun 2014 19:36:41 -0500 Subject: [PATCH] ARM: OMAP2+: powerdomain: pwrdm_for_each_clkdm iterate only valid clkdms No need to invoke callback when the clkdm pointer is NULL. Signed-off-by: Nishanth Menon Reviewed-by: Kevin Hilman Acked-by: Santosh Shilimkar --- arch/arm/mach-omap2/powerdomain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index faebd5f076af..f391948c76b9 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -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; } -- 2.39.5