nios2: fix error handling of irq_of_parse_and_map
authorDmitry Torokhov <dtor@chromium.org>
Mon, 17 Nov 2014 10:36:23 +0000 (18:36 +0800)
committerLey Foon Tan <lftan@altera.com>
Mon, 8 Dec 2014 04:56:08 +0000 (12:56 +0800)
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 <dtor@chromium.org>
Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Ley Foon Tan <lftan@altera.com>
arch/nios2/kernel/time.c

index d90ca1b854e03add7711dc6c951711eee88207f0..23729e81de4a35058a1cc1dfc3345f59df78581a 100644 (file)
@@ -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;