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: Prabhakar X-Patchwork-Id: 3156451 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C833FBEEB2 for ; Fri, 8 Nov 2013 06:46:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C378B2034C for ; Fri, 8 Nov 2013 06:46:57 +0000 (UTC) Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2AC820348 for ; Fri, 8 Nov 2013 06:46:56 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id rA86ktu6027055 for ; Fri, 8 Nov 2013 00:46:55 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rA86kskX023702 for ; Fri, 8 Nov 2013 00:46:55 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Fri, 8 Nov 2013 00:46:55 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rA86kt2f006282 for ; Fri, 8 Nov 2013 00:46:55 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 1ACA380628 for ; Fri, 8 Nov 2013 00:46:55 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id D702C80626 for ; Fri, 8 Nov 2013 00:46:38 -0600 (CST) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id rA86kXp7029841 for ; Fri, 8 Nov 2013 00:46:38 -0600 (CST) Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id rA86kWkg005888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Nov 2013 00:46:33 -0600 Received: from [216.82.242.147:32193] by server-13.bemta-8.messagelabs.com id FE/9E-01034-8C88C725; Fri, 08 Nov 2013 06:46:32 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-2.tower-95.messagelabs.com!1383893191!31042379!1 X-Originating-IP: [209.85.192.176] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.9.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29634 invoked from network); 8 Nov 2013 06:46:32 -0000 Received: from mail-pd0-f176.google.com (HELO mail-pd0-f176.google.com) (209.85.192.176) by server-2.tower-95.messagelabs.com with RC4-SHA encrypted SMTP; 8 Nov 2013 06:46:32 -0000 Received: by mail-pd0-f176.google.com with SMTP id g10so1727830pdj.35 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> CC: , DLOS , LKML , LAK X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 */