aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2013-07-12 05:26:41 -0400
committerMike Turquette <mturquette@linaro.org>2014-01-17 15:37:03 -0500
commit924f9498acb004d8cb704a008f1060fad604ccca (patch)
tree5e3bc623bcda1111662262144d59fb6d028ce8f7
parent519ab8b202f37fb76cc6f32ef34da79716680d03 (diff)
ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm
If the main clock for a hwmod is of basic clock type, it is illegal to type cast this to clk_hw_omap and will result in bogus data. Fixed by checking the clock flags before attempting the type cast. Signed-off-by: Tero Kristo <t-kristo@ti.com> Tested-by: Nishanth Menon <nm@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 8a1b5e0bad40..cc24c95b77e5 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -686,6 +686,8 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh)
686 if (oh->clkdm) { 686 if (oh->clkdm) {
687 return oh->clkdm; 687 return oh->clkdm;
688 } else if (oh->_clk) { 688 } else if (oh->_clk) {
689 if (__clk_get_flags(oh->_clk) & CLK_IS_BASIC)
690 return NULL;
689 clk = to_clk_hw_omap(__clk_get_hw(oh->_clk)); 691 clk = to_clk_hw_omap(__clk_get_hw(oh->_clk));
690 return clk->clkdm; 692 return clk->clkdm;
691 } 693 }