diff mbox

[-next] ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init()

Message ID 1406038688-26417-1-git-send-email-weiyj_lk@163.com (mailing list archive)
State New, archived
Headers show

Commit Message

weiyj_lk@163.com July 22, 2014, 2:18 p.m. UTC
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(-)

Comments

Jason Cooper July 23, 2014, 12:32 p.m. UTC | #1
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.
diff mbox

Patch

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);
 		}
 
 		/*