From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Wei Yongjun <weiyj.lk@gmail.com>, tglx@linutronix.de
Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] clocksource: keystone: Fix return value check in keystone_timer_init()
Date: Thu, 16 Jan 2014 10:37:18 +0100 [thread overview]
Message-ID: <52D7A84E.3090300@linaro.org> (raw)
In-Reply-To: <CAPgLHd-XC6xeUxQJBNe=grLvZUxSc_bcrEVo=Tc1jbyGmHjdgw@mail.gmail.com>
On 01/16/2014 09:29 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, function of_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>
> ---
> drivers/clocksource/timer-keystone.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/timer-keystone.c b/drivers/clocksource/timer-keystone.c
> index cbac8d0..4ca05ec 100644
> --- a/drivers/clocksource/timer-keystone.c
> +++ b/drivers/clocksource/timer-keystone.c
> @@ -168,7 +168,7 @@ static void __init keystone_timer_init(struct device_node *np)
> }
>
> clk = of_clk_get(np, 0);
> - if (!clk) {
> + if (IS_ERR(clk)) {
> pr_err("%s: failed to get clock\n", __func__);
> iounmap(timer.base);
> return;
Good catch. Applied for 3.15.
Thanks for the fix.
-- Daniel
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
prev parent reply other threads:[~2014-01-16 9:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 8:29 [PATCH -next] clocksource: keystone: Fix return value check in keystone_timer_init() Wei Yongjun
2014-01-16 9:37 ` Daniel Lezcano [this message]
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=52D7A84E.3090300@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=weiyj.lk@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