* [PATCH -next] ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init()
@ 2014-07-22 14:18 weiyj_lk
2014-07-23 12:32 ` Jason Cooper
0 siblings, 1 reply; 2+ messages in thread
From: weiyj_lk @ 2014-07-22 14:18 UTC (permalink / raw)
To: Jason Cooper, Andrew Lunn, Gregory Clement,
Sebastian Hesselbarth, Russell King
Cc: Wei Yongjun, linux-arm-kernel, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
In case of error, the function clk_get() returns ERR_PTR()
and never returns 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>
---
arch/arm/mach-mvebu/pmsu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c
index c30b7d7..4f6ef6e 100644
--- a/arch/arm/mach-mvebu/pmsu.c
+++ b/arch/arm/mach-mvebu/pmsu.c
@@ -637,9 +637,9 @@ static int __init armada_xp_pmsu_cpufreq_init(void)
}
clk = clk_get(cpu_dev, 0);
- if (!clk) {
+ if (IS_ERR(clk)) {
pr_err("Cannot get clock for CPU %d\n", cpu);
- return -ENODEV;
+ return PTR_ERR(clk);
}
/*
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init()
2014-07-22 14:18 [PATCH -next] ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init() weiyj_lk
@ 2014-07-23 12:32 ` Jason Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Jason Cooper @ 2014-07-23 12:32 UTC (permalink / raw)
To: weiyj_lk
Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Russell King, Wei Yongjun, linux-arm-kernel, linux-kernel
On Tue, Jul 22, 2014 at 10:18:08PM +0800, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function clk_get() returns ERR_PTR()
> and never returns 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>
> ---
> arch/arm/mach-mvebu/pmsu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to mvebu/soc.
thx,
Jason.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-23 12:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22 14:18 [PATCH -next] ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init() weiyj_lk
2014-07-23 12:32 ` Jason Cooper
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).