public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] openrisc: irq: use irqchip framework
@ 2014-05-19 12:25 Stefan Kristiansson
  2014-05-19 14:44 ` Jonas Bonn
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Kristiansson @ 2014-05-19 12:25 UTC (permalink / raw)
  To: linux-kernel, linux, jonas; +Cc: Stefan Kristiansson

In addition to consolidating the or1k-pic initialization with
how other interrupt controllers are initialized, this makes
OpenRISC less tied to its on-cpu interrupt controller.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
---
 arch/openrisc/kernel/irq.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/openrisc/kernel/irq.c b/arch/openrisc/kernel/irq.c
index 8ec77bc..f6f4683 100644
--- a/arch/openrisc/kernel/irq.c
+++ b/arch/openrisc/kernel/irq.c
@@ -19,10 +19,13 @@
 #include <linux/of.h>
 #include <linux/ftrace.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/export.h>
 #include <linux/irqdomain.h>
 #include <linux/irqflags.h>
 
+#include "../../drivers/irqchip/irqchip.h"
+
 /* read interrupt enabled status */
 unsigned long arch_local_save_flags(void)
 {
@@ -151,24 +154,22 @@ static const struct irq_domain_ops or1k_irq_domain_ops = {
  * 1000 CPU.  This is the "root" domain as these are the interrupts
  * that directly trigger an exception in the CPU.
  */
-static void __init or1k_irq_init(void)
+static int __init
+or1k_irq_init(struct device_node *intc,  struct device_node *parent)
 {
-	struct device_node *intc = NULL;
-
-	/* The interrupt controller device node is mandatory */
-	intc = of_find_compatible_node(NULL, NULL, "opencores,or1k-pic");
-	BUG_ON(!intc);
-
 	/* Disable all interrupts until explicitly requested */
 	mtspr(SPR_PICMR, (0UL));
 
 	root_domain = irq_domain_add_linear(intc, 32,
 					    &or1k_irq_domain_ops, NULL);
+
+	return 0;
 }
+IRQCHIP_DECLARE(or1k_pic, "opencores,or1k-pic", or1k_irq_init);
 
 void __init init_IRQ(void)
 {
-	or1k_irq_init();
+	irqchip_init();
 }
 
 void __irq_entry do_IRQ(struct pt_regs *regs)
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-21  5:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19 12:25 [PATCH] openrisc: irq: use irqchip framework Stefan Kristiansson
2014-05-19 14:44 ` Jonas Bonn
2014-05-19 19:54   ` Stefan Kristiansson
2014-05-20  6:45     ` Jonas Bonn
2014-05-21  5:31       ` Stefan Kristiansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox