mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 21:02:19 +00:00
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>
This commit is contained in:
parent
519ab8b202
commit
924f9498ac
@ -686,6 +686,8 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh)
|
||||
if (oh->clkdm) {
|
||||
return oh->clkdm;
|
||||
} else if (oh->_clk) {
|
||||
if (__clk_get_flags(oh->_clk) & CLK_IS_BASIC)
|
||||
return NULL;
|
||||
clk = to_clk_hw_omap(__clk_get_hw(oh->_clk));
|
||||
return clk->clkdm;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user