diff mbox

OMAP3: hwmod: check for clkdomain pointer before accesing it to change the sleep dependencies.

Message ID 1260098323-26183-1-git-send-email-thara@ti.com (mailing list archive)
State New, archived
Delegated to: Paul Walmsley
Headers show

Commit Message

Thara Gopinath Dec. 6, 2009, 11:18 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 18e6478..3edc387 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -314,8 +314,10 @@  static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)
 	if (!oh->_clk)
 		return -EINVAL;
 
-	return pwrdm_add_sleepdep(oh->_clk->clkdm->pwrdm.ptr,
+	if (oh->_clk->clkdm)
+		return pwrdm_add_sleepdep(oh->_clk->clkdm->pwrdm.ptr,
 				  init_oh->_clk->clkdm->pwrdm.ptr);
+	return 0;
 }
 
 /**
@@ -335,8 +337,10 @@  static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)
 	if (!oh->_clk)
 		return -EINVAL;
 
-	return pwrdm_del_sleepdep(oh->_clk->clkdm->pwrdm.ptr,
+	if (oh->_clk->clkdm)
+		return pwrdm_del_sleepdep(oh->_clk->clkdm->pwrdm.ptr,
 				  init_oh->_clk->clkdm->pwrdm.ptr);
+	return 0;
 }
 
 /**