From patchwork Fri Nov 8 06:45:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 3156461 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 A42939F3C4 for ; Fri, 8 Nov 2013 06:47:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD60620497 for ; Fri, 8 Nov 2013 06:47:29 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD2A620481 for ; Fri, 8 Nov 2013 06:47:28 +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 1VefqI-0007br-RX; Fri, 08 Nov 2013 06:46:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vefq8-00045Q-Kt; Fri, 08 Nov 2013 06:46:44 +0000 Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vefq2-00043L-0o for linux-arm-kernel@lists.infradead.org; Fri, 08 Nov 2013 06:46:39 +0000 Received: by mail-pd0-f181.google.com with SMTP id x10so1727952pdj.12 for ; Thu, 07 Nov 2013 22:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XyHx4t73Q2fBCuaVlFyx6PbKuaUCcG1VxWbDTo3/4dI=; b=crKROXi4Q1yKIlti5EuKr1b3EBquvkiNwVR1MWVMebAOGcLef3ZPjRAKdegCM0ciVI E3RJrbP4GJlFM8QOSoKP9U8/fO5QhrPe8GiClBPQrxBJEfMs8zbd3yX5YIsIRFSkPUqb YkkcjhXa1m2dmezMJ7xUOKmAg2UQSEPwjmqbBpzfIRJqKewFJpIziuNf81CoFKcl6KxZ P+4iuWVrp4C/ehYpHuF0iIUiFfToGDF2x9IGBN+lyLL6+iuaktiU2gQGhks3FFZh6IRx AAPCt2RcQN40sDBVzj7QNhplq0D0aZpcCPOr3pFTN8wGlDMnqPz08YGUXE/WlTcj+mtY sWEw== X-Received: by 10.68.178.68 with SMTP id cw4mr4480872pbc.15.1383893176141; Thu, 07 Nov 2013 22:46:16 -0800 (PST) Received: from localhost.localdomain ([49.200.58.1]) by mx.google.com with ESMTPSA id hu10sm9724184pbc.11.2013.11.07.22.46.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 22:46:15 -0800 (PST) From: Prabhakar Lad To: Sekhar Nori , Linus Walleij , Grygorii Strashko Subject: [PATCH 1/2] gpio: davinci: Fix a check for unbanked gpio Date: Fri, 8 Nov 2013 12:15:55 +0530 Message-Id: <1383893156-28010-2-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1383893156-28010-1-git-send-email-prabhakar.csengg@gmail.com> References: <1383893156-28010-1-git-send-email-prabhakar.csengg@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131108_014638_193316_852F8B7C X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: -2.0 (--) Cc: linux-gpio@vger.kernel.org, DLOS , "Lad, Prabhakar" , LKML , LAK 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: "Lad, Prabhakar" This patch fixes a check for offset in gpio_to_irq_unbanked() and also assigns gpio_irq, gpio_unbanked of chips[0] to appropriate values which is used in gpio_to_irq_unbanked() function. Reported-by: Grygorii Strashko Signed-off-by: Lad, Prabhakar Acked-by: Linus Walleij --- drivers/gpio/gpio-davinci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 8847adf..84be701 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -327,7 +327,7 @@ static int gpio_to_irq_unbanked(struct gpio_chip *chip, unsigned offset) * NOTE: we assume for now that only irqs in the first gpio_chip * can provide direct-mapped IRQs to AINTC (up to 32 GPIOs). */ - if (offset < d->irq_base) + if (offset < d->gpio_unbanked) return d->gpio_irq + offset; else return -ENODEV; @@ -419,6 +419,8 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev) /* pass "bank 0" GPIO IRQs to AINTC */ chips[0].chip.to_irq = gpio_to_irq_unbanked; + chips[0].gpio_irq = bank_irq; + chips[0].gpio_unbanked = pdata->gpio_unbanked; binten = BIT(0); /* AINTC handles mask/unmask; GPIO handles triggering */