From patchwork Tue Nov 22 14:14:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Robert_Deli=C3=ABn?= X-Patchwork-Id: 127088 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 769D1B6F94 for ; Wed, 23 Nov 2011 01:36:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3087B2837B; Tue, 22 Nov 2011 15:36:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TUSkTeuB4jL2; Tue, 22 Nov 2011 15:36:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E17122834C; Tue, 22 Nov 2011 15:36:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1FEA2834C for ; Tue, 22 Nov 2011 15:36:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id grMrsIKDrIh9 for ; Tue, 22 Nov 2011 15:36:53 +0100 (CET) X-Greylist: delayed 1347 seconds by postgrey-1.27 at theia; Tue, 22 Nov 2011 15:36:52 CET X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smarthost.danego.net (smarthost.danego.net [195.246.116.68]) by theia.denx.de (Postfix) with ESMTP id 4905A28330 for ; Tue, 22 Nov 2011 15:36:52 +0100 (CET) Received: from smtp.danego.net (smtp.danego.net [195.246.116.61]) by smarthost.danego.net (Postfix) with ESMTP id 1DC1B1C281CB; Tue, 22 Nov 2011 15:36:47 +0100 (CET) From: =?iso-8859-1?Q?Robert_Deli=EBn?= To: "u-boot@lists.denx.de" Thread-Topic: [PATCH] M28: Fix OB1 bug in GPIO driver Thread-Index: AQHMqSDKVRRWkBF0dkW7s2bL1Sx6OA== Date: Tue, 22 Nov 2011 14:14:22 +0000 Message-ID: Accept-Language: en-GB, nl-NL, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [57.66.175.6] MIME-Version: 1.0 X-Spam: Subject: [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This patch fixes a small off-by-one bug in the GPIO driver for the mxs platform that allowed the selection gpio pins of one bank more than the SoC actually has. Signed-off-by: Robert Deliƫn Acked-by: Marek Vasut Acked-by: Marek Vasut diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c index b7e9591..539738b 100644 --- a/drivers/gpio/mxs_gpio.c +++ b/drivers/gpio/mxs_gpio.c @@ -120,7 +120,7 @@ int gpio_direction_output(int gp, int value) int gpio_request(int gp, const char *label) { - if (PAD_BANK(gp) > PINCTRL_BANKS) + if (PAD_BANK(gp) >= PINCTRL_BANKS) return -EINVAL; return 0;