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: 6051541 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 225CA9F440 for ; Thu, 19 Mar 2015 17:26:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43E5720525 for ; Thu, 19 Mar 2015 17:26:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 556072050B for ; Thu, 19 Mar 2015 17:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757439AbbCSR0K (ORCPT ); Thu, 19 Mar 2015 13:26:10 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:35218 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757407AbbCSR0F (ORCPT ); Thu, 19 Mar 2015 13:26:05 -0400 Received: by lbcgn8 with SMTP id gn8so57937592lbc.2 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=I08HP019fegHcyIYWYT2Ej/ATdr8X5JPjaGoZ5j7PRvYGoSyuyDxUkngdZDKTBN53l jzd9Jmf2AesDuxGHta6TW4eUGs0St+JYqZMLYoZLrsoT0PAabiEumxRSTDv9Sg8vvjAL mo4qcCUTvh9X9hOjIISqoTgmdYA5XucGNbXkGNGITuXiROInFU5jIar1U9RtchHaAt2l t0/I/B62RpiC+3cNfEFqFCM0grA8HwTSe964SOrCLvzl06rLSu8eQ5As9dJ9j0x5AWn0 WomDgy06Rrn+WWo2vb/ZhS+7df/xfiJY+0/cDUMORTDbc3YvORM/3cv+9dkpStYt4ryC m62A== X-Gm-Message-State: ALoCoQnBwKcSFm7kbiW7TiHhm8jkDb6pI/u4HNB8WFDDQfnvH9GOS/0VFGYynmDMMMpgBeitQsIp 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 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)) {