Skip to content

Commit

Permalink
clk: at91: Fix a return value in case of error
Browse files Browse the repository at this point in the history
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 f5644f1 ("clk: at91: Migrate to clk_hw based registration
and OF APIs")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  • Loading branch information
Christophe JAILLET authored and Stephen Boyd committed Oct 20, 2016
1 parent 5c6201e commit 91bbc17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/at91/clk-programmable.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ at91_clk_register_programmable(struct regmap *regmap,
ret = clk_hw_register(NULL, &prog->hw);
if (ret) {
kfree(prog);
hw = &prog->hw;
hw = ERR_PTR(ret);
}

return hw;
Expand Down

0 comments on commit 91bbc17

Please sign in to comment.