提交 fddf4e29 编写于 作者: A Andreas Kemnade 提交者: Tero Kristo

clk: ti: check clock type before doing autoidle ops

Code might use autoidle api with clocks not being omap2 clocks,
so check if clock type is really omap2.
Signed-off-by: NAndreas Kemnade <andreas@kemnade.info>
Acked-by: NTony Lindgren <tony@atomide.com>
Tested-by: NKeerthy <j-keerthy@ti.com>
Signed-off-by: NTero Kristo <t-kristo@ti.com>
上级 d277ce2d
......@@ -82,9 +82,15 @@ static int _omap2_clk_allow_idle(struct clk_hw_omap *clk)
*/
int omap2_clk_deny_idle(struct clk *clk)
{
struct clk_hw_omap *c = to_clk_hw_omap(__clk_get_hw(clk));
struct clk_hw *hw = __clk_get_hw(clk);
return _omap2_clk_deny_idle(c);
if (omap2_clk_is_hw_omap(hw)) {
struct clk_hw_omap *c = to_clk_hw_omap(hw);
return _omap2_clk_deny_idle(c);
}
return -EINVAL;
}
/**
......@@ -95,9 +101,15 @@ int omap2_clk_deny_idle(struct clk *clk)
*/
int omap2_clk_allow_idle(struct clk *clk)
{
struct clk_hw_omap *c = to_clk_hw_omap(__clk_get_hw(clk));
struct clk_hw *hw = __clk_get_hw(clk);
if (omap2_clk_is_hw_omap(hw)) {
struct clk_hw_omap *c = to_clk_hw_omap(hw);
return _omap2_clk_allow_idle(c);
}
return _omap2_clk_allow_idle(c);
return -EINVAL;
}
static void _allow_autoidle(struct clk_ti_autoidle *clk)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册