All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 08/18] Blackfin: gpio: optimize free path a little
Date: Tue, 28 Jun 2011 15:36:17 -0400	[thread overview]
Message-ID: <1309289787-7846-9-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1309289787-7846-1-git-send-email-vapier@gentoo.org>

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 <vapier@gentoo.org>
---
 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);
-- 
1.7.5.3

  parent reply	other threads:[~2011-06-28 19:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 19:36 [U-Boot] [PATCH 00/18] Blackfin updates for v2011.09 Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 01/18] Blackfin: uart: move debug buffers into local bss Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 02/18] Blackfin: uart: add multiple serial support Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 03/18] Blackfin: adi boards: enable multi serial support by default Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 04/18] Blackfin: dont reset SWRST on newer bf526 parts Mike Frysinger
2011-07-05  5:24   ` [U-Boot] [PATCH v2] " Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 05/18] Blackfin: add init.elf helper code Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 06/18] Blackfin: uart: fix printf warning Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 07/18] Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR Mike Frysinger
2011-06-28 19:36 ` Mike Frysinger [this message]
2011-06-28 19:36 ` [U-Boot] [PATCH 09/18] Blackfin: sync MMR read/write helpers with Linux Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 10/18] Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 11/18] Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 12/18] Blackfin: portmux: allow header to be included in assembly files Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 13/18] Blackfin: drop unused dma.h header from start code Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 14/18] Blackfin: adi boards: enable pretty flash progress output Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 15/18] Blackfin: split out async setup Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 16/18] Blackfin: serial: convert to bfin_{read, write} helpers Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 17/18] Blackfin: update anomaly lists to latest public info Mike Frysinger
2011-06-28 19:36 ` [U-Boot] [PATCH 18/18] Blackfin: adi boards: also set stderr to nc with helper Mike Frysinger
2011-06-29  2:50 ` [U-Boot] Pull request u-boot-blackfin.git Mike Frysinger
2011-06-29 21:23   ` Wolfgang Denk
2011-06-30 15:45     ` Mike Frysinger
2011-06-30 15:55       ` Wolfgang Denk
2011-06-29 21:23 ` [U-Boot] [PATCH 00/18] Blackfin updates for v2011.09 Wolfgang Denk
2011-06-30 17:23 ` Mike Frysinger
2011-07-05  5:25 ` [U-Boot] [PATCH 19/21] Blackfin: serial: move early debug strings into .rodata section Mike Frysinger
2011-07-05  5:25   ` [U-Boot] [PATCH 20/21] Blackfin: switch to common display_options() Mike Frysinger
2011-07-05  5:25   ` [U-Boot] [PATCH 21/21] Blackfin: jtag-console: fix timer usage Mike Frysinger
2011-07-12  6:21 ` [U-Boot] [PATCH 00/18] Blackfin updates for v2011.09 Mike Frysinger
2011-07-12  6:23 ` [U-Boot] Pull request u-boot-blackfin.git Mike Frysinger
2011-08-02 19:49   ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309289787-7846-9-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.