Skip to content

Commit

Permalink
irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maxime Ripard committed Apr 8, 2013
1 parent 119fd63 commit f1dc6c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 42 deletions.
5 changes: 2 additions & 3 deletions arch/arm/mach-sunxi/sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/irqchip.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/io.h>

#include <linux/clk/sunxi.h>
#include <linux/irqchip/sunxi.h>

#include <asm/mach/arch.h>
#include <asm/mach/map.h>
Expand Down Expand Up @@ -104,8 +104,7 @@ static const char * const sunxi_board_dt_compat[] = {
DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
.init_machine = sunxi_dt_init,
.map_io = sunxi_map_io,
.init_irq = sunxi_init_irq,
.handle_irq = sunxi_handle_irq,
.init_irq = irqchip_init,
.restart = sunxi_restart,
.init_time = sunxi_timer_init,
.dt_compat = sunxi_board_dt_compat,
Expand Down
22 changes: 10 additions & 12 deletions drivers/irqchip/irq-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
#include <linux/of_address.h>
#include <linux/of_irq.h>

#include <linux/irqchip/sunxi.h>
#include <asm/exception.h>
#include <asm/mach/irq.h>

#include "irqchip.h"

#define SUNXI_IRQ_VECTOR_REG 0x00
#define SUNXI_IRQ_PROTECTION_REG 0x08
Expand All @@ -33,6 +36,8 @@
static void __iomem *sunxi_irq_base;
static struct irq_domain *sunxi_irq_domain;

static asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs);

void sunxi_irq_ack(struct irq_data *irqd)
{
unsigned int irq = irqd_to_hwirq(irqd);
Expand Down Expand Up @@ -125,20 +130,13 @@ static int __init sunxi_of_init(struct device_node *node,
if (!sunxi_irq_domain)
panic("%s: unable to create IRQ domain\n", node->full_name);

return 0;
}

static struct of_device_id sunxi_irq_dt_ids[] __initconst = {
{ .compatible = "allwinner,sunxi-ic", .data = sunxi_of_init },
{ }
};
set_handle_irq(sunxi_handle_irq);

void __init sunxi_init_irq(void)
{
of_irq_init(sunxi_irq_dt_ids);
return 0;
}
IRQCHIP_DECLARE(allwinner_sunxi_ic, "allwinner,sunxi-ic", sunxi_of_init);

asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs)
static asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs)
{
u32 irq, hwirq;

Expand Down
27 changes: 0 additions & 27 deletions include/linux/irqchip/sunxi.h

This file was deleted.

0 comments on commit f1dc6c4

Please sign in to comment.