arm: add set_handle_irq() to register the parent IRQ controller handler function
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 20 Nov 2012 22:00:53 +0000 (23:00 +0100)
committerRob Herring <rob.herring@calxeda.com>
Thu, 10 Jan 2013 17:44:38 +0000 (11:44 -0600)
In order to allow irqchip drivers to register their IRQ handling
function as the parent IRQ controller handler function, we provide a
convenience function. This will avoid poking directly into the global
handle_arch_irq variable.

Suggested by Arnd Bergmann.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Rob Herring: remove warning. 1st one to initialize wins.]
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Olof Johansson <olof@lixom.net>
arch/arm/include/asm/mach/irq.h
arch/arm/kernel/irq.c

index 15cb035309f754ca4c5b3e4c4fa718e6a27252ac..18c883023339a39ad246e6de7a066106365e3078 100644 (file)
@@ -22,6 +22,7 @@ extern int show_fiq_list(struct seq_file *, int);
 
 #ifdef CONFIG_MULTI_IRQ_HANDLER
 extern void (*handle_arch_irq)(struct pt_regs *);
+extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
 #endif
 
 /*
index 896165096d6a936572bdcfd0d21cc23f01cb9ea2..8e4ef4c83a741bc0c5fd3a48735a9b6377a9ba71 100644 (file)
@@ -117,6 +117,16 @@ void __init init_IRQ(void)
        machine_desc->init_irq();
 }
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
+{
+       if (handle_arch_irq)
+               return;
+
+       handle_arch_irq = handle_irq;
+}
+#endif
+
 #ifdef CONFIG_SPARSE_IRQ
 int __init arch_probe_nr_irqs(void)
 {