[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1406038688-26417-1-git-send-email-weiyj_lk@163.com>
Date: Tue, 22 Jul 2014 22:18:08 +0800
From: weiyj_lk@....com
To: Jason Cooper <jason@...edaemon.net>, Andrew Lunn <andrew@...n.ch>,
Gregory Clement <gregory.clement@...e-electrons.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Russell King <linux@....linux.org.uk>
Cc: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH -next] ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init()
From: Wei Yongjun <yongjun_wei@...ndmicro.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@...ndmicro.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);
}
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists