* [PATCH -next] clk: sunxi: fix return value check
@ 2013-07-16 12:17 Wei Yongjun
2013-07-16 12:22 ` Maxime Ripard
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-07-16 12:17 UTC (permalink / raw)
To: mturquette, emilio, gregory.clement, maxime.ripard, cate
Cc: yongjun_wei, linux-arm-kernel, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
In case of error, the function clk_register_composite() and
clk_register_factors() returns ERR_PTR() not NULL. The NULL test
in the return value check should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/clk/sunxi/clk-sunxi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 412912b..02e440b 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -64,7 +64,7 @@ static void __init sunxi_osc_clk_setup(struct device_node *node)
&gate->hw, &clk_gate_ops,
CLK_IS_ROOT);
- if (clk) {
+ if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk);
clk_register_clkdev(clk, clk_name, NULL);
}
@@ -221,7 +221,7 @@ static void __init sunxi_factors_clk_setup(struct device_node *node,
clk = clk_register_factors(NULL, clk_name, parent, 0, reg,
data->table, data->getter, &clk_lock);
- if (clk) {
+ if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk);
clk_register_clkdev(clk, clk_name, NULL);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] clk: sunxi: fix return value check
2013-07-16 12:17 [PATCH -next] clk: sunxi: fix return value check Wei Yongjun
@ 2013-07-16 12:22 ` Maxime Ripard
0 siblings, 0 replies; 2+ messages in thread
From: Maxime Ripard @ 2013-07-16 12:22 UTC (permalink / raw)
To: Wei Yongjun
Cc: mturquette, emilio, gregory.clement, cate, yongjun_wei,
linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 688 bytes --]
Hi Wei,
On Tue, Jul 16, 2013 at 08:17:45PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function clk_register_composite() and
> clk_register_factors() returns ERR_PTR() not NULL. The NULL test
> in the return value check should be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Thanks for this patch, but Axel Lin already sent a equivalent patch for
this issue last week:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-July/183138.html
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-16 12:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-16 12:17 [PATCH -next] clk: sunxi: fix return value check Wei Yongjun
2013-07-16 12:22 ` Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox