diff mbox

[U-Boot,08/18] Blackfin: gpio: optimize free path a little

Message ID 1309289787-7846-9-git-send-email-vapier@gentoo.org
State Accepted
Commit 95b4b9d97a5bb6a93ec269cb9cf85e95a8f8295d
Delegated to: Mike Frysinger
Headers show

Commit Message

Mike Frysinger June 28, 2011, 7:36 p.m. UTC
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 mbox


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;
 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");
 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 {
 void bfin_gpio_labels(void);
+void bfin_gpio_free(unsigned gpio);
 #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)
@@ -154,7 +156,6 @@  int bfin_special_gpio_request(unsigned gpio, const char *label);
 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);