Skip to contentSkip to conversation

OMAP: HWMOD: Adding clockdomain check.

PATCH In review Thara Gopinath 2 participants 2 messages Feb 23, 2010 – Feb 27, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 clockdomian.

---
 arch/arm/mach-omap2/omap_hwmod.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +2 -0
index 70912d1..97fd635 100644
@@ -1440,6 +1440,8 @@ 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;
 
 }
Signature · 1 line
1.5.4.7
maintainer
#1 lore raw
Quoted 7 lines · Thara Gopinath

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 clockdomian.

Thanks, queued for .34-rcX.

- Paul