Gitweb: http://git.kernel.org/linus/d5647c18eac9a313a89a3049a9fff51b20021a44
Commit: d5647c18eac9a313a89a3049a9fff51b20021a44
Parent: 2eaa9cfdf33b8d7fb7aff27792192e0019ae8fc6
Author: Thara Gopinath <thara@ti.com>
AuthorDate: Wed Mar 31 04:16:29 2010 -0600
Committer: Paul Walmsley <paul@pwsan.com>
CommitDate: Wed Mar 31 04:16:29 2010 -0600
OMAP: HWMOD: Adding clockdomain check
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>
---
arch/arm/mach-omap2/omap_hwmod.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index c664947..e436dcb 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -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;
}
--