From patchwork Wed Feb 22 12:14:15 2012 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: 6881 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 9F1C11CCAC6 for ; Wed, 22 Feb 2012 12:08:07 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 634BFA186DE for ; Wed, 22 Feb 2012 12:08:07 +0000 (UTC) Received: by iabz7 with SMTP id z7so14332530iab.11 for ; Wed, 22 Feb 2012 04:08:06 -0800 (PST) Received: from mr.google.com ([10.50.155.231]) by 10.50.155.231 with SMTP id vz7mr25845282igb.26.1329912486896 (num_hops = 1); Wed, 22 Feb 2012 04:08:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.155.231 with SMTP id vz7mr20854516igb.26.1329912486781; Wed, 22 Feb 2012 04:08:06 -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.231.11.10 with SMTP id r10csp133314ibr; Wed, 22 Feb 2012 04:08:06 -0800 (PST) Received: by 10.50.153.234 with SMTP id vj10mr21148082igb.16.1329912485413; Wed, 22 Feb 2012 04:08:05 -0800 (PST) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id q7si28586151pbf.57.2012.02.22.04.08.05; Wed, 22 Feb 2012 04:08:05 -0800 (PST) Received-SPF: neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.33; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LZS001Z0N0P8LB0@mailout3.samsung.com> for patches@linaro.org; Wed, 22 Feb 2012 21:08:04 +0900 (KST) X-AuditID: cbfee61a-b7b78ae000001ceb-0e-4f44daa45379 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id BD.15.07403.4AAD44F4; Wed, 22 Feb 2012 21:08:04 +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 <0LZS00GJLN166U60@mmp1.samsung.com> for patches@linaro.org; Wed, 22 Feb 2012 21:08:04 +0900 (KST) From: Thomas Abraham To: linux-samsung-soc@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH v3 1/4] ARM: Exynos4: Simplify EINT number to linux irq number translation Date: Wed, 22 Feb 2012 17:44:15 +0530 Message-id: <1329912858-32750-2-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1329912858-32750-1-git-send-email-thomas.abraham@linaro.org> References: <1329912858-32750-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== X-Gm-Message-State: ALoCoQlMUy0XKKLb46T6A0GmXoIrGW9TsWzjKH1cH7BFZ5NPkhkPxMaJ5typPbVWyZ/h5DIiQyWh 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/common.c | 26 +++----------------------- 1 files changed, 3 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index ac5ac0e..7dd9dd0 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -550,27 +550,7 @@ void __init exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no) 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) { @@ -748,9 +728,9 @@ static 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); }