From patchwork Tue Apr 10 14:26:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikram Narayanan X-Patchwork-Id: 151586 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 C46A7B700C for ; Wed, 11 Apr 2012 00:26:49 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 305D828083; Tue, 10 Apr 2012 16:26:37 +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 O0xW+icn7kGM; Tue, 10 Apr 2012 16:26:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CCE842808F; Tue, 10 Apr 2012 16:26:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BD5E2808F for ; Tue, 10 Apr 2012 16:26:33 +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 ToWJkETP0KiX for ; Tue, 10 Apr 2012 16:26:33 +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 B27CA28083 for ; Tue, 10 Apr 2012 16:26:30 +0200 (CEST) Received: by dakh32 with SMTP id h32so6440628dak.23 for ; Tue, 10 Apr 2012 07:26:29 -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:cc:subject :content-type:content-transfer-encoding; bh=HpbM6bAoRWPHjYZCWGz8pyEA7yKA5eLf0pIijW1nTzw=; b=F5AzNeHyVp9FJ+V3E/kBZUdaWhdftGO4PmcbfDyD7AxA2aPrqr1Pthh6uHkoFIYfCn vFtCoPNT8FlfFm+U80nWp2h51IItBBYvbiv9Yfj4HiIB92XmKlplJ6db6iqF9kPOIyne jfDlT4n2mRlH+tmX95axd9fh9YDkhcn/gDkK91q8xRHd+ptjFBDPBLaP2HfGBzUXVXbf Qn6VHP3FHlHWcxQHk3A6MuPa93TXUBDsFg5GgH1NIU44bsdPlAHBF3JyQLqJBARqdUwa PturTtUuWgKCR6TAd+X8+JiquiAN7bvWQVP0wC8+0qC4hjT8aNkzFGR92lQPSD8i8akZ LDNQ== Received: by 10.68.225.104 with SMTP id rj8mr29324573pbc.135.1334067989003; Tue, 10 Apr 2012 07:26:29 -0700 (PDT) Received: from [115.184.97.209] ([115.184.97.209]) by mx.google.com with ESMTPS id q5sm23011pbp.28.2012.04.10.07.26.25 (version=SSLv3 cipher=OTHER); Tue, 10 Apr 2012 07:26:28 -0700 (PDT) Message-ID: <4F84430C.7060204@gmail.com> Date: Tue, 10 Apr 2012 19:56:20 +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 Subject: [U-Boot] [PATCH v2 3/4] imx: Use GPIO_TO_PORT macro in the gpio driver 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 Use the defined GPIO_TO_PORT macro. Remove gpio >> 5 references. Signed-off-by: Vikram Narayanan Acked-by: Stefano Babic --- drivers/gpio/mxc_gpio.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index 7e65b39..21b1cdc 100644 --- a/drivers/gpio/mxc_gpio.c +++ b/drivers/gpio/mxc_gpio.c @@ -54,7 +54,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; @@ -81,7 +81,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; @@ -104,7 +104,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; @@ -122,7 +122,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;