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 <nm@ti.com> Reviewed-by: Kevin Hilman <khilman@linaro.org> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
This commit is contained in:
parent
9f5dc91b69
commit
13bbffd4eb
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue