From b03e119fff8a06f55faaaa11c6259829fe81cbb4 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Tue, 22 Jul 2014 22:18:08 +0800 Subject: ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init() 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 Link: https://lkml.kernel.org/r/1406038688-26417-1-git-send-email-weiyj_lk@163.com Signed-off-by: Jason Cooper --- arch/arm/mach-mvebu/pmsu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-mvebu') diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c index 0ca285fdd569..0b617ae3ceb9 100644 --- a/arch/arm/mach-mvebu/pmsu.c +++ b/arch/arm/mach-mvebu/pmsu.c @@ -424,9 +424,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); } /* -- cgit v1.2.3