Skip to content

Commit

Permalink
OMAP: HWMOD: Adding clockdomain check
Browse files Browse the repository at this point in the history
This patch adds check for presence of clockdomain structure in the API
omap_hwmod_get_pwrdm before trying to access the powerdomain structure.
This will prevent unnecessary crashing of the system in case of a
clock node with out an associated clockdomain.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
  • Loading branch information
Thara Gopinath authored and Paul Walmsley committed Mar 31, 2010
1 parent 2eaa9cf commit d5647c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,9 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh)
c = oh->slaves[oh->_mpu_port_index]->_clk;
}

if (!c->clkdm)
return NULL;

return c->clkdm->pwrdm.ptr;

}
Expand Down

0 comments on commit d5647c1

Please sign in to comment.