Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 f5644f10dcfb ("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>

authored by

Christophe JAILLET and committed by
Stephen Boyd
91bbc174 5c6201e6

+1 -1
+1 -1
drivers/clk/at91/clk-programmable.c
··· 203 203 ret = clk_hw_register(NULL, &prog->hw); 204 204 if (ret) { 205 205 kfree(prog); 206 - hw = &prog->hw; 206 + hw = ERR_PTR(ret); 207 207 } 208 208 209 209 return hw;