From patchwork Tue Jun 28 19:36:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 102466 X-Patchwork-Delegate: vapier@gentoo.org 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 9F357B6F64 for ; Wed, 29 Jun 2011 05:38:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D3762826C; Tue, 28 Jun 2011 21:37:48 +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 3lH+tQyA-F0y; Tue, 28 Jun 2011 21:37:48 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7FBB2281F5; Tue, 28 Jun 2011 21:36:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 10B0D28175 for ; Tue, 28 Jun 2011 21:36:44 +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 O3jYi5LnUaOA for ; Tue, 28 Jun 2011 21:36:43 +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 smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by theia.denx.de (Postfix) with ESMTPS id 772B12818C for ; Tue, 28 Jun 2011 21:36:36 +0200 (CEST) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 5E37B1BC02A for ; Tue, 28 Jun 2011 19:36:33 +0000 (UTC) From: Mike Frysinger To: u-boot@lists.denx.de Date: Tue, 28 Jun 2011 15:36:17 -0400 Message-Id: <1309289787-7846-9-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1309289787-7846-1-git-send-email-vapier@gentoo.org> References: <1309289787-7846-1-git-send-email-vapier@gentoo.org> Subject: [U-Boot] [PATCH 08/18] Blackfin: gpio: optimize free path a little X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de When we aren't doing resource tracking, the gpio_free() function is a stub that simply returns, so pull this logic up a level and make it an inline stub in the header. Now we don't have to waste time at any of the call sites. Signed-off-by: Mike Frysinger --- arch/blackfin/cpu/gpio.c | 2 ++ arch/blackfin/include/asm/gpio.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/blackfin/cpu/gpio.c b/arch/blackfin/cpu/gpio.c index cb96721..5674d42 100644 --- a/arch/blackfin/cpu/gpio.c +++ b/arch/blackfin/cpu/gpio.c @@ -665,6 +665,7 @@ int bfin_gpio_request(unsigned gpio, const char *label) return 0; } +#ifdef CONFIG_BFIN_GPIO_TRACK void bfin_gpio_free(unsigned gpio) { if (check_gpio(gpio) < 0) @@ -679,6 +680,7 @@ void bfin_gpio_free(unsigned gpio) set_label(gpio, "free"); } +#endif #ifdef BFIN_SPECIAL_GPIO_BANKS DECLARE_RESERVED_MAP(special_gpio, gpio_bank(MAX_RESOURCES)); diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 9c0e5d1..224688f 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h @@ -142,8 +142,10 @@ struct gpio_port_t { #ifdef CONFIG_BFIN_GPIO_TRACK void bfin_gpio_labels(void); +void bfin_gpio_free(unsigned gpio); #else #define bfin_gpio_labels() +#define bfin_gpio_free(gpio) #define bfin_gpio_request(gpio, label) bfin_gpio_request(gpio) #define bfin_special_gpio_request(gpio, label) bfin_special_gpio_request(gpio) #endif @@ -154,7 +156,6 @@ int bfin_special_gpio_request(unsigned gpio, const char *label); #endif int bfin_gpio_request(unsigned gpio, const char *label); -void bfin_gpio_free(unsigned gpio); int bfin_gpio_direction_input(unsigned gpio); int bfin_gpio_direction_output(unsigned gpio, int value); int bfin_gpio_get_value(unsigned gpio);