From patchwork Fri Apr 12 14:03:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2435831 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8AE6ADF2A1 for ; Fri, 12 Apr 2013 14:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750810Ab3DLODk (ORCPT ); Fri, 12 Apr 2013 10:03:40 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:52030 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751290Ab3DLODj (ORCPT ); Fri, 12 Apr 2013 10:03:39 -0400 Received: from wuerfel.lan (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M5a7E-1UkeOY1r4K-00xc9n; Fri, 12 Apr 2013 16:03:38 +0200 From: Arnd Bergmann To: Kukjin Kim Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Chanho Park , Tushar Behera , Tomasz Figa , Thomas Abraham , Kyungmin Park , Arnd Bergmann , Arnd Bergmann , Thomas Gleixner Subject: [PATCH 6/7] irqchip: exynos: localize irq lookup for ATAGS Date: Fri, 12 Apr 2013 16:03:24 +0200 Message-Id: <1365775405-115297-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1365775405-115297-1-git-send-email-arnd@arndb.de> References: <1365775405-115297-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:fhPtmVnlNooK4HhPAr9IOl0fvc7GV7SZojAAi7K6kCL kkk+zENSoi5TYweM3C8ulzEtQJKWxsrP+Z5tUkGrqRiY6nVKAC grMb2JsIad8GuhqbkcXbpQfj26o7u+P11bv3BFattW5zyByvN8 LxQKY6/RGOFh8FB3FGWh6PkgFPYTr9vE6gxT2wVOK/gSBkwPje cvDzxUZ3O11n/1iXHlubH0mHJQNFH17ZJ1uDfxKAZ8N1GF7IEn Ha5p0ZKpbIJIRS1LXI1WVBj+WLSBUQtznqXSvntSmtJ7BOSp+7 jcB3mazjcFTDjpp5NQ4Wtroc2iOV1vxTR8IcL5MYZU2roYOVDm o3KtOn1Fs8KjeZ7g8FDFIw0e/g6hpBHX1/M3gFaIf Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The IRQ_SPI() macro is not available in the driver when building with sparse IRQs or multiplatform, so let's move all users of this into one function that we can leave out when building DT-only. Signed-off-by: Arnd Bergmann Cc: Thomas Gleixner --- drivers/irqchip/exynos-combiner.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c index 7fcdeee..acb9c74 100644 --- a/drivers/irqchip/exynos-combiner.c +++ b/drivers/irqchip/exynos-combiner.c @@ -18,7 +18,9 @@ #include #include +#ifdef CONFIG_EXYNOS_ATAGS #include +#endif #include "irqchip.h" @@ -182,8 +184,12 @@ static struct irq_domain_ops combiner_irq_domain_ops = { .map = combiner_irq_domain_map, }; -static unsigned int exynos4x12_combiner_extra_irq(int group) +static unsigned int combiner_lookup_irq(int group) { +#ifdef CONFIG_EXYNOS_ATAGS + if (group < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250()) + return IRQ_SPI(group); + switch (group) { case 16: return IRQ_SPI(107); @@ -193,9 +199,9 @@ static unsigned int exynos4x12_combiner_extra_irq(int group) return IRQ_SPI(48); case 19: return IRQ_SPI(42); - default: - return 0; } +#endif + return 0; } void __init combiner_init(void __iomem *combiner_base, @@ -228,14 +234,13 @@ void __init combiner_init(void __iomem *combiner_base, } for (i = 0; i < max_nr; i++) { - if (i < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250()) - irq = IRQ_SPI(i); - else - irq = exynos4x12_combiner_extra_irq(i); #ifdef CONFIG_OF if (np) irq = irq_of_parse_and_map(np, i); + else #endif + irq = combiner_lookup_irq(i); + combiner_init_one(&combiner_data[i], i, combiner_base + (i >> 2) * 0x10, irq); combiner_cascade_irq(&combiner_data[i], irq);