Skip to contentSkip to conversation

nios2: fix error handling of irq_of_parse_and_map

PATCH In review Dmitry Torokhov 3 participants 3 messages Nov 14, 2014 – Nov 17, 2014 NIOS2 architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

Not tested, found by casual code inspection.

 arch/nios2/kernel/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nios2/kernel/time.c +1 -1
index d90ca1b..23729e8 100644
@@ -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;
Signature · 5 lines
2.1.0.rc2.206.gedb03e5


-- 
Dmitry