From patchwork Sun Dec 11 06:51:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 5574 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5FF9E23E21 for ; Sun, 11 Dec 2011 06:50:18 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 4F676A18310 for ; Sun, 11 Dec 2011 06:50:18 +0000 (UTC) Received: by mail-bw0-f52.google.com with SMTP id 17so5858557bke.11 for ; Sat, 10 Dec 2011 22:50:18 -0800 (PST) Received: by 10.204.152.83 with SMTP id f19mr7315405bkw.90.1323586218117; Sat, 10 Dec 2011 22:50:18 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.129.2 with SMTP id hg2cs17220bkc; Sat, 10 Dec 2011 22:50:17 -0800 (PST) Received: by 10.68.74.4 with SMTP id p4mr21209878pbv.123.1323586215540; Sat, 10 Dec 2011 22:50:15 -0800 (PST) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id g9si18501312pbj.269.2011.12.10.22.50.14; Sat, 10 Dec 2011 22:50:15 -0800 (PST) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm2.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LW1003YX1NO9830@mailout4.samsung.com> for patches@linaro.org; Sun, 11 Dec 2011 15:50:14 +0900 (KST) X-AuditID: cbfee61b-b7b95ae00000198b-8f-4ee452a6c6c8 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id 59.4F.06539.6A254EE4; Sun, 11 Dec 2011 15:50:14 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0LW100EBB1NIOE80@mmp1.samsung.com> for patches@linaro.org; Sun, 11 Dec 2011 15:50:14 +0900 (KST) From: Thomas Abraham To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH v2 1/4] ARM: Exynos4: Simplify EINT number to linux irq number translation Date: Sun, 11 Dec 2011 12:21:38 +0530 Message-id: <1323586301-24537-2-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1323586301-24537-1-git-send-email-thomas.abraham@linaro.org> References: <1323586301-24537-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== The exynos4_get_irq_nr function that converts a given wakeup interrupt source number to a linux irq number is simplified and replaced with the new macro exynos4_irq_eint_to_gic_irq. Signed-off-by: Thomas Abraham --- arch/arm/mach-exynos/irq-eint.c | 25 +++---------------------- 1 files changed, 3 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-exynos/irq-eint.c b/arch/arm/mach-exynos/irq-eint.c index badb8c6..5e89412 100644 --- a/arch/arm/mach-exynos/irq-eint.c +++ b/arch/arm/mach-exynos/irq-eint.c @@ -29,26 +29,7 @@ static DEFINE_SPINLOCK(eint_lock); static unsigned int eint0_15_data[16]; -static unsigned int exynos4_get_irq_nr(unsigned int number) -{ - u32 ret = 0; - - switch (number) { - case 0 ... 3: - ret = (number + IRQ_EINT0); - break; - case 4 ... 7: - ret = (number + (IRQ_EINT4 - 4)); - break; - case 8 ... 15: - ret = (number + (IRQ_EINT8 - 8)); - break; - default: - printk(KERN_ERR "number available : %d\n", number); - } - - return ret; -} +#define exynos4_irq_eint_to_gic_irq(number) (IRQ_EINT0 + number) static inline void exynos4_irq_eint_mask(struct irq_data *data) { @@ -225,9 +206,9 @@ int __init exynos4_init_irq_eint(void) for (irq = 0 ; irq <= 15 ; irq++) { eint0_15_data[irq] = IRQ_EINT(irq); - irq_set_handler_data(exynos4_get_irq_nr(irq), + irq_set_handler_data(exynos4_irq_eint_to_gic_irq(irq), &eint0_15_data[irq]); - irq_set_chained_handler(exynos4_get_irq_nr(irq), + irq_set_chained_handler(exynos4_irq_eint_to_gic_irq(irq), exynos4_irq_eint0_15); }