From: caesar.upstream@gmail.com (Caesar Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] clocksource/drivers/rockchip: Fix bad NO_IRQ usage
Date: Wed, 30 Sep 2015 18:17:33 +0800 [thread overview]
Message-ID: <560BB6BD.4080509@gmail.com> (raw)
In-Reply-To: <1443607710-10415-1-git-send-email-daniel.lezcano@linaro.org>
? 2015?09?30? 18:08, Daniel Lezcano ??:
> The current code assumes the 'irq_of_parse_and_map' will return NO_IRQ in case
> of failure. Unfortunately, the NO_IRQ is not consistent across the different
> architectures and we must not rely on it.
>
> NO_IRQ is equal to '-1' on ARM and 'irq_of_parse_and_map' returns '0' in case
> of an error. Hence, the latter won't be detected and will lead to a crash.
>
> Fix this by just checking 'irq' is different from zero.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
As Per- discuss, you can free add my test tag.
Tested-by: Caesar Wang <wxt@rock-chips.com>
> ---
> drivers/clocksource/rockchip_timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c
> index bb2c2b0..d3c1742 100644
> --- a/drivers/clocksource/rockchip_timer.c
> +++ b/drivers/clocksource/rockchip_timer.c
> @@ -148,7 +148,7 @@ static void __init rk_timer_init(struct device_node *np)
> bc_timer.freq = clk_get_rate(timer_clk);
>
> irq = irq_of_parse_and_map(np, 0);
> - if (irq == NO_IRQ) {
> + if (!irq) {
> pr_err("Failed to map interrupts for '%s'\n", TIMER_NAME);
> return;
> }
--
Thanks,
Caesar
prev parent reply other threads:[~2015-09-30 10:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 10:07 [GIT PULL] clockevents: a couple of fixes 4.3 Daniel Lezcano
2015-09-30 10:08 ` [PATCH 1/2] clocksource/drivers/rockchip: Fix bad NO_IRQ usage Daniel Lezcano
2015-09-30 10:08 ` [PATCH 2/2] clocksource/drivers/keystone: " Daniel Lezcano
2015-09-30 15:26 ` santosh shilimkar
2015-09-30 10:17 ` Caesar Wang [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=560BB6BD.4080509@gmail.com \
--to=caesar.upstream@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).