From patchwork Thu Jul 4 16:31:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 2823861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 493589F9D2 for ; Thu, 4 Jul 2013 16:32:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35ED420150 for ; Thu, 4 Jul 2013 16:32:48 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB53720143 for ; Thu, 4 Jul 2013 16:32:46 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UumSM-0002Mj-0e; Thu, 04 Jul 2013 16:32:30 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UumSJ-0005Av-AK; Thu, 04 Jul 2013 16:32:27 +0000 Received: from mail-pd0-f180.google.com ([209.85.192.180]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UumSC-0005A8-Kr for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2013 16:32:21 +0000 Received: by mail-pd0-f180.google.com with SMTP id 10so1230005pdi.11 for ; Thu, 04 Jul 2013 09:31:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :mime-version:content-transfer-encoding:x-gm-message-state; bh=9bsxRI+OgORW1Xsvmet9F6YKvBKUPHM5EkplSiSMYCU=; b=E8F5fOAOmiLGKHv7iqsw+UFoiJLnICIn5geEJwltOPrzYF/RkwLsq9gv6UBx2Bo9nr 2A1Fx4X5UgHpxlTiekaE6SJNe1CCbZS4OrnWQX/x54B/MYvYHtMQErClGjwIP70J2Mr8 ucYLUM/fI+6API9A185O+qUN7i9zkOS1GaPKOmn1vlvmHVpi+VgxHF6zsdYmyu9LdIJb jbVFPWB0eKyPf7ec81lJqH1Lv8mlMkk+aiDu6rHtjM9+96A4k4pC06Z4TDUlEPAw60gD nWsqStf/meMEy1VoUYiRUtaC5sUUJDvhDZ8QxM7CyjIiP1ZWYmyX2LsydRofmcZ90lI3 0PDQ== X-Received: by 10.68.201.66 with SMTP id jy2mr6191524pbc.90.1372955514236; Thu, 04 Jul 2013 09:31:54 -0700 (PDT) Received: from [192.168.0.100] (114-39-109-134.dynamic.hinet.net. [114.39.109.134]) by mx.google.com with ESMTPSA id cx3sm3438465pbb.30.2013.07.04.09.31.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Jul 2013 09:31:51 -0700 (PDT) Message-ID: <1372955496.9018.2.camel@phoenix> Subject: [PATCH] irqchip: bcm2835: Convert to use IRQCHIP_DECLARE macro From: Axel Lin To: Thomas Gleixner Date: Fri, 05 Jul 2013 00:31:36 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQkKqYku/7lJQrlzO9MjCpB9R8Kxcl5veyoZi74eHL79htWTGlWw2LkZRU8/jy+WhKpE32Su X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130704_123220_809039_399F98B6 X-CRM114-Status: GOOD ( 21.02 ) X-Spam-Score: -1.9 (-) Cc: Arnd Bergmann , Stephen Warren , Simon Arlott , linux-rpi-kernel@lists.infradead.org, Olof Johansson , linux-arm-kernel@lists.infradead.org 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch converts irq-bcm2835 driver to use the new IRQCHIP_DECLARE and irqchip_init. Signed-off-by: Axel Lin Acked-by: Stephen Warren Tested-by: Stephen Warren --- arch/arm/mach-bcm2835/bcm2835.c | 5 ++--- drivers/irqchip/irq-bcm2835.c | 22 ++++++++++------------ include/linux/irqchip/bcm2835.h | 29 ----------------------------- 3 files changed, 12 insertions(+), 44 deletions(-) delete mode 100644 include/linux/irqchip/bcm2835.h diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c index 40686d7..a4abd85 100644 --- a/arch/arm/mach-bcm2835/bcm2835.c +++ b/arch/arm/mach-bcm2835/bcm2835.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include @@ -131,8 +131,7 @@ static const char * const bcm2835_compat[] = { DT_MACHINE_START(BCM2835, "BCM2835") .map_io = bcm2835_map_io, - .init_irq = bcm2835_init_irq, - .handle_irq = bcm2835_handle_irq, + .init_irq = irqchip_init, .init_machine = bcm2835_init, .init_time = clocksource_of_init, .restart = bcm2835_restart, diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c index 16c78f1..c29408e 100644 --- a/drivers/irqchip/irq-bcm2835.c +++ b/drivers/irqchip/irq-bcm2835.c @@ -49,9 +49,11 @@ #include #include #include -#include #include +#include + +#include "irqchip.h" /* Put the bank and irq (32 bits) into the hwirq */ #define MAKE_HWIRQ(b, n) ((b << 5) | (n)) @@ -93,6 +95,8 @@ struct armctrl_ic { }; static struct armctrl_ic intc __read_mostly; +static asmlinkage void __exception_irq_entry bcm2835_handle_irq( + struct pt_regs *regs); static void armctrl_mask_irq(struct irq_data *d) { @@ -164,17 +168,9 @@ static int __init armctrl_of_init(struct device_node *node, set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } } - return 0; -} - -static struct of_device_id irq_of_match[] __initconst = { - { .compatible = "brcm,bcm2835-armctrl-ic", .data = armctrl_of_init }, - { } -}; -void __init bcm2835_init_irq(void) -{ - of_irq_init(irq_of_match); + set_handle_irq(bcm2835_handle_irq); + return 0; } /* @@ -200,7 +196,7 @@ static void armctrl_handle_shortcut(int bank, struct pt_regs *regs, handle_IRQ(irq_linear_revmap(intc.domain, irq), regs); } -asmlinkage void __exception_irq_entry bcm2835_handle_irq( +static asmlinkage void __exception_irq_entry bcm2835_handle_irq( struct pt_regs *regs) { u32 stat, irq; @@ -222,3 +218,5 @@ asmlinkage void __exception_irq_entry bcm2835_handle_irq( } } } + +IRQCHIP_DECLARE(bcm2835_armctrl_ic, "brcm,bcm2835-armctrl-ic", armctrl_of_init); diff --git a/include/linux/irqchip/bcm2835.h b/include/linux/irqchip/bcm2835.h deleted file mode 100644 index 48a859b..0000000 --- a/include/linux/irqchip/bcm2835.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2010 Broadcom - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LINUX_IRQCHIP_BCM2835_H_ -#define __LINUX_IRQCHIP_BCM2835_H_ - -#include - -extern void bcm2835_init_irq(void); - -extern asmlinkage void __exception_irq_entry bcm2835_handle_irq( - struct pt_regs *regs); - -#endif