[PATCH] Make irq_dispose_mapping(NO_IRQ) a nop

Michael Ellerman michael at ellerman.id.au
Tue Oct 24 13:37:34 EST 2006


It makes for a friendlier API if irq_dispose_mapping(NO_IRQ) is a
nop, rather than triggering a WARN_ON.

Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---

 arch/powerpc/kernel/irq.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: git/arch/powerpc/kernel/irq.c
===================================================================
--- git.orig/arch/powerpc/kernel/irq.c
+++ git/arch/powerpc/kernel/irq.c
@@ -626,10 +626,14 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
 
 void irq_dispose_mapping(unsigned int virq)
 {
-	struct irq_host *host = irq_map[virq].host;
+	struct irq_host *host;
 	irq_hw_number_t hwirq;
 	unsigned long flags;
 
+	if (virq == NO_IRQ)
+		return;
+
+	host = irq_map[virq].host;
 	WARN_ON (host == NULL);
 	if (host == NULL)
 		return;



More information about the Linuxppc-dev mailing list