ARM: imx: Use IRQCHIP_DECLARE for TZIC
authorAlexander Shiyan <shc_work@mail.ru>
Wed, 1 Jun 2016 19:07:32 +0000 (22:07 +0300)
committerShawn Guo <shawnguo@kernel.org>
Sun, 12 Jun 2016 11:47:18 +0000 (19:47 +0800)
Remove boilerplate code by using IRQCHIP_DECLARE macro.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/mach-imx/common.h
arch/arm/mach-imx/mach-imx50.c
arch/arm/mach-imx/mach-imx51.c
arch/arm/mach-imx/mach-imx53.c
arch/arm/mach-imx/tzic.c

index 58a38464480d3cf1e46302d4b010dcdeaea41638..60d9ae63f76eed4ee170494b89122aa70e2df188 100644 (file)
@@ -32,7 +32,6 @@ void imx27_init_early(void);
 void imx31_init_early(void);
 void imx35_init_early(void);
 void mxc_init_irq(void __iomem *);
-void tzic_init_irq(void);
 void mx1_init_irq(void);
 void mx21_init_irq(void);
 void mx27_init_irq(void);
index ecf58b9e974b136a8beff6388eab9ee31abd694e..4cab5f61260fec49c24060ad0e131a046e7f8be5 100644 (file)
@@ -22,6 +22,5 @@ static const char * const imx50_dt_board_compat[] __initconst = {
 };
 
 DT_MACHINE_START(IMX50_DT, "Freescale i.MX50 (Device Tree Support)")
-       .init_irq       = tzic_init_irq,
        .dt_compat      = imx50_dt_board_compat,
 MACHINE_END
index 10a82a4f1e5889894c04519cf257a7059e282191..7296c31849a8af4e9d4f1132c9b7b34eb344116e 100644 (file)
@@ -69,7 +69,6 @@ static const char * const imx51_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
        .init_early     = imx51_init_early,
-       .init_irq       = tzic_init_irq,
        .init_machine   = imx51_dt_init,
        .init_late      = imx51_init_late,
        .dt_compat      = imx51_dt_board_compat,
index 18b5c5c136db94aeb0456e3fd248f7943e7f85c2..d251cecd9bd2efa835d1424ab719655de71c3358 100644 (file)
@@ -49,7 +49,6 @@ static const char * const imx53_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)")
        .init_early     = imx53_init_early,
-       .init_irq       = tzic_init_irq,
        .init_machine   = imx53_dt_init,
        .init_late      = imx53_init_late,
        .dt_compat      = imx53_dt_board_compat,
index ae23d50f7861b4d804e38025927922f0eb5f6e1f..a53fdc263a37dda204f83598907a91e5754bb65c 100644 (file)
@@ -9,12 +9,11 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-#include <linux/module.h>
-#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/errno.h>
 #include <linux/io.h>
+#include <linux/irqchip.h>
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -153,13 +152,11 @@ static void __exception_irq_entry tzic_handle_irq(struct pt_regs *regs)
  * interrupts. It registers the interrupt enable and disable functions
  * to the kernel for each interrupt source.
  */
-void __init tzic_init_irq(void)
+static int __init tzic_init_dt(struct device_node *np, struct device_node *p)
 {
-       struct device_node *np;
        int irq_base;
        int i;
 
-       np = of_find_compatible_node(NULL, NULL, "fsl,tzic");
        tzic_base = of_iomap(np, 0);
        WARN_ON(!tzic_base);
 
@@ -199,7 +196,10 @@ void __init tzic_init_irq(void)
 #endif
 
        pr_info("TrustZone Interrupt Controller (TZIC) initialized\n");
+
+       return 0;
 }
+IRQCHIP_DECLARE(tzic, "fsl,tzic", tzic_init_dt);
 
 /**
  * tzic_enable_wake() - enable wakeup interrupt