From patchwork Sun Apr 6 14:58:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 3943501 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 7FAD99F369 for ; Sun, 6 Apr 2014 15:02:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B004B20395 for ; Sun, 6 Apr 2014 15:02:14 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 984C22037D for ; Sun, 6 Apr 2014 15:02:13 +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 1WWoYO-0000EV-R7; Sun, 06 Apr 2014 15:00:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WWoY8-0003G4-Ke; Sun, 06 Apr 2014 14:59:56 +0000 Received: from bhuna.collabora.co.uk ([93.93.135.160]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WWoXb-0003AC-8x for linux-arm-kernel@lists.infradead.org; Sun, 06 Apr 2014 14:59:23 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: javier) with ESMTPSA id A7AA9600B19 From: Javier Martinez Canillas To: Linus Walleij Subject: [PATCH 1/5] gpio: omap: convert to use irq_domain_add_simple() Date: Sun, 6 Apr 2014 16:58:13 +0200 Message-Id: <1396796297-13002-2-git-send-email-javier.martinez@collabora.co.uk> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396796297-13002-1-git-send-email-javier.martinez@collabora.co.uk> References: <1396796297-13002-1-git-send-email-javier.martinez@collabora.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140406_105923_422405_22B4641F X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.2 (--) Cc: Nishanth Menon , Paul Walmsley , Kevin Hilman , Aaro Koskinen , Tony Lindgren , linux-gpio@vger.kernel.org, Santosh Shilimkar , linux-omap@vger.kernel.org, Javier Martinez Canillas , 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: , MIME-Version: 1.0 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.5 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 The GPIO OMAP driver supports different OMAP SoC families and not all of them have the needed support to use the linear IRQ domain mapping like OMAP1 that use the legacy domain mapping. But this special check is not necessary since the simple IRQ domain mapping is able to handle both cases. Having a zero IRQ offset will be interpreted as a linear domain case while a non-zero value will be interpreted as a legacy domain case. Signed-off-by: Javier Martinez Canillas Acked-by: Santosh Shilimkar --- drivers/gpio/gpio-omap.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 19b886c..3ee9b8d 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1138,9 +1138,7 @@ static int omap_gpio_probe(struct platform_device *pdev) const struct omap_gpio_platform_data *pdata; struct resource *res; struct gpio_bank *bank; -#ifdef CONFIG_ARCH_OMAP1 - int irq_base; -#endif + int irq_base = 0; match = of_match_device(of_match_ptr(omap_gpio_match), dev); @@ -1185,21 +1183,16 @@ static int omap_gpio_probe(struct platform_device *pdev) #ifdef CONFIG_ARCH_OMAP1 /* * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop - * irq_alloc_descs() and irq_domain_add_legacy() and just use a - * linear IRQ domain mapping for all OMAP platforms. + * irq_alloc_descs() since a base IRQ offset will no longer be needed. */ irq_base = irq_alloc_descs(-1, 0, bank->width, 0); if (irq_base < 0) { dev_err(dev, "Couldn't allocate IRQ numbers\n"); return -ENODEV; } - - bank->domain = irq_domain_add_legacy(node, bank->width, irq_base, - 0, &irq_domain_simple_ops, NULL); -#else - bank->domain = irq_domain_add_linear(node, bank->width, - &irq_domain_simple_ops, NULL); #endif + bank->domain = irq_domain_add_simple(node, bank->width, irq_base, + &irq_domain_simple_ops, NULL); if (!bank->domain) { dev_err(dev, "Couldn't register an IRQ domain\n"); return -ENODEV;