提交 91bbc174 编写于 作者: C Christophe JAILLET 提交者: Stephen Boyd

clk: at91: Fix a return value in case of error

If 'clk_hw_register()' fails, it is likely that we expect to return an
error instead of a valid pointer (which would mean success).

Fix commit f5644f10 ("clk: at91: Migrate to clk_hw based registration
and OF APIs")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 5c6201e6
...@@ -203,7 +203,7 @@ at91_clk_register_programmable(struct regmap *regmap, ...@@ -203,7 +203,7 @@ at91_clk_register_programmable(struct regmap *regmap,
ret = clk_hw_register(NULL, &prog->hw); ret = clk_hw_register(NULL, &prog->hw);
if (ret) { if (ret) {
kfree(prog); kfree(prog);
hw = &prog->hw; hw = ERR_PTR(ret);
} }
return hw; return hw;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册