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: 3943421 Return-Path: X-Original-To: patchwork-linux-omap@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 B70819F369 for ; Sun, 6 Apr 2014 14:59:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D13CF2037D for ; Sun, 6 Apr 2014 14:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF8E820357 for ; Sun, 6 Apr 2014 14:59:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754142AbaDFO7B (ORCPT ); Sun, 6 Apr 2014 10:59:01 -0400 Received: from bhuna.collabora.co.uk ([93.93.135.160]:40469 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753352AbaDFO6y (ORCPT ); Sun, 6 Apr 2014 10:58:54 -0400 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 Cc: Santosh Shilimkar , Kevin Hilman , Tony Lindgren , Paul Walmsley , Aaro Koskinen , Nishanth Menon , linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Javier Martinez Canillas 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> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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;