From: weiyj_lk@163.com
To: Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Gregory Clement <gregory.clement@free-electrons.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Russell King <linux@arm.linux.org.uk>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH -next] ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init()
Date: Tue, 22 Jul 2014 22:18:08 +0800 [thread overview]
Message-ID: <1406038688-26417-1-git-send-email-weiyj_lk@163.com> (raw)
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);
}
/*
next reply other threads:[~2014-07-22 14:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 14:18 weiyj_lk [this message]
2014-07-23 12:32 ` [PATCH -next] ARM: mvebu: fix return value check in armada_xp_pmsu_cpufreq_init() Jason Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406038688-26417-1-git-send-email-weiyj_lk@163.com \
--to=weiyj_lk@163.com \
--cc=andrew@lunn.ch \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=sebastian.hesselbarth@gmail.com \
--cc=yongjun_wei@trendmicro.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).