OSDN Git Service

ARM: irq: Call irqchip_init if no init_irq function is specified
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 28 Mar 2013 20:46:44 +0000 (21:46 +0100)
committerOlof Johansson <olof@lixom.net>
Tue, 2 Apr 2013 18:05:40 +0000 (11:05 -0700)
More and more sub-architectures are using only the irqchip_init
function. Make the core code call this function if no init_irq field is
provided in the machine description to remove some boilerplate code.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/kernel/irq.c

index 8e4ef4c..9723d17 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/random.h>
 #include <linux/smp.h>
 #include <linux/init.h>
@@ -114,7 +115,10 @@ EXPORT_SYMBOL_GPL(set_irq_flags);
 
 void __init init_IRQ(void)
 {
-       machine_desc->init_irq();
+       if (IS_ENABLED(CONFIG_OF) && !machine_desc->init_irq)
+               irqchip_init();
+       else
+               machine_desc->init_irq();
 }
 
 #ifdef CONFIG_MULTI_IRQ_HANDLER