From patchwork Mon Mar 25 13:30:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 2331281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 6D2A0DF24C for ; Mon, 25 Mar 2013 13:36:59 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UK7XK-0004SW-Vw; Mon, 25 Mar 2013 13:34:07 +0000 Received: from mail.free-electrons.com ([94.23.35.102]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UK7U6-0003BP-If for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2013 13:30:53 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id EFBBAE52; Mon, 25 Mar 2013 14:30:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 4468CD54; Mon, 25 Mar 2013 14:30:45 +0100 (CET) From: Maxime Ripard To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/10] irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro Date: Mon, 25 Mar 2013 14:30:29 +0100 Message-Id: <1364218233-29636-7-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364218233-29636-1-git-send-email-maxime.ripard@free-electrons.com> References: <1364218233-29636-1-git-send-email-maxime.ripard@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130325_093046_862957_572FBCA7 X-CRM114-Status: GOOD ( 17.39 ) X-Spam-Score: -3.2 (---) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-3.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , linux-kernel@vger.kernel.org, Thomas Gleixner , sunny@allwinnertech.com, shuge@allwinnertech.com, Maxime Ripard , kevin@allwinnertech.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- arch/arm/mach-sunxi/sunxi.c | 6 ++---- drivers/irqchip/irq-sunxi.c | 22 ++++++++++------------ include/linux/irqchip/sunxi.h | 27 --------------------------- 3 files changed, 12 insertions(+), 43 deletions(-) delete mode 100644 include/linux/irqchip/sunxi.h diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c index 2c01182..634e335 100644 --- a/arch/arm/mach-sunxi/sunxi.c +++ b/arch/arm/mach-sunxi/sunxi.c @@ -14,13 +14,12 @@ #include #include #include +#include #include #include #include #include -#include - #include #include @@ -97,8 +96,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 = clocksource_of_init, .dt_compat = sunxi_board_dt_compat, diff --git a/drivers/irqchip/irq-sunxi.c b/drivers/irqchip/irq-sunxi.c index 10974fa..0fc49c5 100644 --- a/drivers/irqchip/irq-sunxi.c +++ b/drivers/irqchip/irq-sunxi.c @@ -20,7 +20,10 @@ #include #include -#include +#include +#include + +#include "irqchip.h" #define SUNXI_IRQ_VECTOR_REG 0x00 #define SUNXI_IRQ_PROTECTION_REG 0x08 @@ -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); @@ -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; diff --git a/include/linux/irqchip/sunxi.h b/include/linux/irqchip/sunxi.h deleted file mode 100644 index 1fe2c22..0000000 --- a/include/linux/irqchip/sunxi.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012 Maxime Ripard - * - * Maxime Ripard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __LINUX_IRQCHIP_SUNXI_H -#define __LINUX_IRQCHIP_SUNXI_H - -#include - -extern void sunxi_init_irq(void); - -extern asmlinkage void __exception_irq_entry sunxi_handle_irq( - struct pt_regs *regs); - -#endif