From b29438f22c807d8a4bda6f0fb3e24318117906c0 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Mon, 17 Nov 2014 18:36:23 +0800 Subject: [PATCH] nios2: fix error handling of irq_of_parse_and_map Return value of irq_of_parse_and_map() is unsigned int, with 0 indicating failure, so testing for negative result never works. Signed-off-by: Dmitry Torokhov Reviewed-by: Tobias Klauser Acked-by: Ley Foon Tan --- arch/nios2/kernel/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nios2/kernel/time.c b/arch/nios2/kernel/time.c index d90ca1b854e0..23729e81de4a 100644 --- a/arch/nios2/kernel/time.c +++ b/arch/nios2/kernel/time.c @@ -228,7 +228,7 @@ static __init void nios2_clockevent_init(struct device_node *timer) nios2_timer_get_base_and_freq(timer, &iobase, &freq); irq = irq_of_parse_and_map(timer, 0); - if (irq < 0) + if (!irq) panic("Unable to parse timer irq\n"); nios2_ce.timer.base = iobase; -- 2.30.2