* [PATCH v2] clk: at91: Fix a return value in case of error
@ 2016-09-25 11:53 Christophe JAILLET
2016-10-20 23:42 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2016-09-25 11:53 UTC (permalink / raw)
To: boris.brezillon, mturquette, sboyd
Cc: linux-clk, linux-kernel, kernel-janitors, Christophe JAILLET
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>
---
v2: clk_hw_register does return an error or 0. So we can use it.
This proposal is un-compiled and un-tested.
I get an error when I run 'make drivers/clk/at91/' which is likely due to
my building environment.
---
drivers/clk/at91/clk-programmable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c
index 190122e64a3a..2cf200e22d48 100644
--- a/drivers/clk/at91/clk-programmable.c
+++ b/drivers/clk/at91/clk-programmable.c
@@ -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;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-20 23:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-25 11:53 [PATCH v2] clk: at91: Fix a return value in case of error Christophe JAILLET
2016-10-20 23:42 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).