From patchwork Wed Dec 7 13:59:49 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: 5528 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 A61CD23E18 for ; Wed, 7 Dec 2011 13:58:35 +0000 (UTC) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by fiordland.canonical.com (Postfix) with ESMTP id 9CBEDA18522 for ; Wed, 7 Dec 2011 13:58:35 +0000 (UTC) Received: by eekc14 with SMTP id c14so573066eek.11 for ; Wed, 07 Dec 2011 05:58:35 -0800 (PST) Received: by 10.14.9.163 with SMTP id 35mr3791672eet.234.1323266315428; Wed, 07 Dec 2011 05:58:35 -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 hg2cs71247bkc; Wed, 7 Dec 2011 05:58:35 -0800 (PST) Received: by 10.68.29.37 with SMTP id g5mr5647154pbh.122.1323266312111; Wed, 07 Dec 2011 05:58:32 -0800 (PST) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id t1si3356974pbi.145.2011.12.07.05.58.31; Wed, 07 Dec 2011 05:58:32 -0800 (PST) Received-SPF: neutral (google.com: 203.254.224.25 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.25; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.25 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 (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LVU007956T8LU40@mailout2.samsung.com> for patches@linaro.org; Wed, 07 Dec 2011 22:58:30 +0900 (KST) X-AuditID: cbfee61a-b7b89ae000001a15-f5-4edf7106bf6c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 66.F2.06677.6017FDE4; Wed, 07 Dec 2011 22:58:30 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0LVU00BJT6TAY680@mmp2.samsung.com> for patches@linaro.org; Wed, 07 Dec 2011 22:58:30 +0900 (KST) From: Thomas Abraham To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH 1/4] arm: exynos4: simplify EINT number to linux irq number translation Date: Wed, 07 Dec 2011 19:29:49 +0530 Message-id: <1323266392-28330-2-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1323266392-28330-1-git-send-email-thomas.abraham@linaro.org> References: <1323266392-28330-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); }