From patchwork Wed Apr 4 16:06:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikram Narayanan X-Patchwork-Id: 150770 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 69566B702B for ; Thu, 5 Apr 2012 02:46:30 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A0B7028203; Wed, 4 Apr 2012 18:46:05 +0200 (CEST) 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 OrgNZyLYiiqn; Wed, 4 Apr 2012 18:46:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E7C428204; Wed, 4 Apr 2012 18:45:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 05DDE281BB for ; Wed, 4 Apr 2012 18:13:36 +0200 (CEST) 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 U0G0mzftcCcw for ; Wed, 4 Apr 2012 18:13:35 +0200 (CEST) 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 mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by theia.denx.de (Postfix) with ESMTPS id 31D78281B2 for ; Wed, 4 Apr 2012 18:13:33 +0200 (CEST) Received: by dakh32 with SMTP id h32so429931dak.23 for ; Wed, 04 Apr 2012 09:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=mn/eIl8+QlYx3jmzo4qdfBbFR1fNtIrBgz1a3bpgPUA=; b=FZBas/sA/Ewo6qCpJygCLytS4TsuuyWdRserEvTJCjlOTGEdujCUO08QUwTlHv6Bjl iYIBZMLxeH0q+6DoKwbEtiyrPKz84c00lXyeW6gzOToyc7sioCE1jPdBUiRAKJ95tRaV xjjJwm5i+6oTg10K5eSsPNX/3MRyiTB29S69SGnRAXBoV3fWluZ5oDiXjDtGXFkiK0p9 xiUxpCyboFOP77xHBfyK++zlwTV3p0AmvRxjb226eEdEqlKIqwl0AQ9V0201Svpjuhff zk3eO4S0oi5efg9kiwW1G0t1zMjr9hCPqYU9psUQBcdTlEt7Y4xRyt/NARH45QYb5ZUZ fvnA== Received: by 10.68.203.132 with SMTP id kq4mr17460369pbc.83.1333555594535; Wed, 04 Apr 2012 09:06:34 -0700 (PDT) Received: from [115.242.148.239] ([115.242.148.239]) by mx.google.com with ESMTPS id z1sm906595pbc.38.2012.04.04.09.06.31 (version=SSLv3 cipher=OTHER); Wed, 04 Apr 2012 09:06:33 -0700 (PDT) Message-ID: <4F7C7181.7000406@gmail.com> Date: Wed, 04 Apr 2012 21:36:25 +0530 From: Vikram Narayanan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: u-boot@lists.denx.de X-Mailman-Approved-At: Wed, 04 Apr 2012 18:45:01 +0200 Subject: [U-Boot] [PATCH 2/3] imx: Use GPIO_TO_PORT macro instead of (gpio >> 5) 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 imx: Use GPIO_TO_PORT macro instead of (gpio >> 5) Signed-off-by: Vikram Narayanan --- drivers/gpio/mxc_gpio.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) 100.0% drivers/gpio/ diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index df6bbbb..c4ef001 100644 --- a/drivers/gpio/mxc_gpio.c +++ b/drivers/gpio/mxc_gpio.c @@ -53,7 +53,7 @@ static unsigned long gpio_ports[] = { static int mxc_gpio_direction(unsigned int gpio, enum mxc_gpio_direction direction) { - unsigned int port = gpio >> 5; + unsigned int port = GPIO_TO_PORT(gpio); struct gpio_regs *regs; u32 l; @@ -80,7 +80,7 @@ static int mxc_gpio_direction(unsigned int gpio, int gpio_set_value(unsigned gpio, int value) { - unsigned int port = gpio >> 5; + unsigned int port = GPIO_TO_PORT(gpio); struct gpio_regs *regs; u32 l; @@ -103,7 +103,7 @@ int gpio_set_value(unsigned gpio, int value) int gpio_get_value(unsigned gpio) { - unsigned int port = gpio >> 5; + unsigned int port = GPIO_TO_PORT(gpio); struct gpio_regs *regs; u32 val; @@ -121,7 +121,7 @@ int gpio_get_value(unsigned gpio) int gpio_request(unsigned gpio, const char *label) { - unsigned int port = gpio >> 5; + unsigned int port = GPIO_TO_PORT(gpio); if (port >= ARRAY_SIZE(gpio_ports)) return -1; return 0;