From patchwork Thu Mar 19 17:25:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: grygorii.strashko@linaro.org X-Patchwork-Id: 452093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 576B0140083 for ; Fri, 20 Mar 2015 04:30:19 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964849AbbCSR0p (ORCPT ); Thu, 19 Mar 2015 13:26:45 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:36552 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757377AbbCSR0F (ORCPT ); Thu, 19 Mar 2015 13:26:05 -0400 Received: by lbblx11 with SMTP id lx11so35867701lbb.3 for ; Thu, 19 Mar 2015 10:26:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/eiw4UA34XV8nHLYdW6I8LdqDzn6pB0qMrzIWk9brgE=; b=LeCgKzJkVbdWxlpxneE1c9/MhGoTVFtQYll/e89Xu/98z8IrRjPqgKWq/gNz4167Y9 FbWiDYd6Ge39EkfO0a4LeYP6JqoDuJc6BlWuNiilE31VrFfS5UlKO85I6ito3CNtCZDZ mDf05eARHh+eKB0DrReopu3HSIWA7Mz9/brNSVz4/i2PsFKzLlaNIu7JoB8EA3Qq1hbS KqUD5bhP3IGVibsk5wpEpJt8AYJrCkj1OGrhkcmO+2e1BC/4eEox5A0Xz7GVqbzsl7Ej CSSM7rFxdOHjl5NrqsUMXd3dfzaRUIV74z68oMu8K4pb3s/Dkmm5dTdIg80DoG+9cJFJ wQbw== X-Gm-Message-State: ALoCoQnKL+yt9fidjAOgAM0IM9RscYUQzegfGg4yh68lHvoR7OXv3oBSaELAnnMyS49c6xI6RONZ X-Received: by 10.112.167.138 with SMTP id zo10mr5476406lbb.75.1426785963738; Thu, 19 Mar 2015 10:26:03 -0700 (PDT) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id kd7sm405417lbc.42.2015.03.19.10.26.03 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 10:26:03 -0700 (PDT) From: To: Javier Martinez Canillas , Linus Walleij , Alexandre Courbot , ssantosh@kernel.org, Kevin Hilman , tony@atomide.com Cc: linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Grygorii Strashko Subject: [RFT OMAP1 PATCH 7/8] gpio: omap: get rid of omap_irq_to_gpio() Date: Thu, 19 Mar 2015 19:25:43 +0200 Message-Id: <1426785944-17255-8-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426785944-17255-1-git-send-email-grygorii.strashko@linaro.org> References: <1426785944-17255-1-git-send-email-grygorii.strashko@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Grygorii Strashko Now OMAP GPIO driver prepared for omap_irq_to_gpio() removing. Do it ;) Signed-off-by: Grygorii Strashko Acked-by: Javier Martinez Canillas --- drivers/gpio/gpio-omap.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index dd7934a..615e950 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -89,11 +89,6 @@ struct gpio_bank { static void omap_gpio_unmask_irq(struct irq_data *d); -static int omap_irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq) -{ - return bank->chip.base + gpio_irq; -} - static inline struct gpio_bank *omap_irq_data_get_bank(struct irq_data *d) { struct gpio_chip *chip = irq_data_get_irq_chip_data(d); @@ -490,22 +485,21 @@ static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned offset) static int omap_gpio_irq_type(struct irq_data *d, unsigned type) { struct gpio_bank *bank = omap_irq_data_get_bank(d); - unsigned gpio = 0; int retval; unsigned long flags; - unsigned offset; + unsigned offset = d->hwirq; if (!BANK_USED(bank)) pm_runtime_get_sync(bank->dev); #ifdef CONFIG_ARCH_OMAP1 - if (d->irq > IH_MPUIO_BASE) + if (d->irq > IH_MPUIO_BASE) { + unsigned gpio = 0; gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); + offset = GPIO_INDEX(bank, gpio); + } #endif - if (!gpio) - gpio = omap_irq_to_gpio(bank, d->hwirq); - if (type & ~IRQ_TYPE_SENSE_MASK) return -EINVAL; @@ -514,7 +508,6 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type) return -EINVAL; spin_lock_irqsave(&bank->lock, flags); - offset = GPIO_INDEX(bank, gpio); retval = omap_set_gpio_triggering(bank, offset, type); omap_gpio_init_irq(bank, offset); if (!omap_gpio_is_input(bank, offset)) {