aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2013-03-10 10:54:46 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2013-04-08 15:42:27 -0400
commitf1dc6c4f77678979868fe220c6913890e13473d8 (patch)
tree7c1e1c28537fe7dde8ed6708f8105dbe01fccaa4 /drivers/irqchip
parent119fd635e383c1a58990e5805acc29f48ed3e360 (diff)
irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro
This allows to remove some boilerplate code. At the same time, call the set_handle_irq function in the initialization function of the irqchip, so that we can remove it from the machine declaration. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-sunxi.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/irqchip/irq-sunxi.c b/drivers/irqchip/irq-sunxi.c
index 10974fa42653..0fc49c577033 100644
--- a/drivers/irqchip/irq-sunxi.c
+++ b/drivers/irqchip/irq-sunxi.c
@@ -20,7 +20,10 @@
20#include <linux/of_address.h> 20#include <linux/of_address.h>
21#include <linux/of_irq.h> 21#include <linux/of_irq.h>
22 22
23#include <linux/irqchip/sunxi.h> 23#include <asm/exception.h>
24#include <asm/mach/irq.h>
25
26#include "irqchip.h"
24 27
25#define SUNXI_IRQ_VECTOR_REG 0x00 28#define SUNXI_IRQ_VECTOR_REG 0x00
26#define SUNXI_IRQ_PROTECTION_REG 0x08 29#define SUNXI_IRQ_PROTECTION_REG 0x08
@@ -33,6 +36,8 @@
33static void __iomem *sunxi_irq_base; 36static void __iomem *sunxi_irq_base;
34static struct irq_domain *sunxi_irq_domain; 37static struct irq_domain *sunxi_irq_domain;
35 38
39static asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs);
40
36void sunxi_irq_ack(struct irq_data *irqd) 41void sunxi_irq_ack(struct irq_data *irqd)
37{ 42{
38 unsigned int irq = irqd_to_hwirq(irqd); 43 unsigned int irq = irqd_to_hwirq(irqd);
@@ -125,20 +130,13 @@ static int __init sunxi_of_init(struct device_node *node,
125 if (!sunxi_irq_domain) 130 if (!sunxi_irq_domain)
126 panic("%s: unable to create IRQ domain\n", node->full_name); 131 panic("%s: unable to create IRQ domain\n", node->full_name);
127 132
128 return 0; 133 set_handle_irq(sunxi_handle_irq);
129}
130
131static struct of_device_id sunxi_irq_dt_ids[] __initconst = {
132 { .compatible = "allwinner,sunxi-ic", .data = sunxi_of_init },
133 { }
134};
135 134
136void __init sunxi_init_irq(void) 135 return 0;
137{
138 of_irq_init(sunxi_irq_dt_ids);
139} 136}
137IRQCHIP_DECLARE(allwinner_sunxi_ic, "allwinner,sunxi-ic", sunxi_of_init);
140 138
141asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs) 139static asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs)
142{ 140{
143 u32 irq, hwirq; 141 u32 irq, hwirq;
144 142