]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Blackfin: gpio: optimize free path a little
authorMike Frysinger <vapier@gentoo.org>
Tue, 10 May 2011 16:56:58 +0000 (12:56 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 12 Jul 2011 06:17:45 +0000 (02:17 -0400)
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
arch/blackfin/include/asm/gpio.h

index cb96721cf4a7b910e6b57eec984d2098c0dfdee2..5674d42b6dca826b2118f8a6f6d3053fe9117a98 100644 (file)
@@ -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));
index 9c0e5d1954d87c7d2961a3732e04ed276fbf6f0d..224688fc5426953bc8d5807945c83265c3cc8135 100644 (file)
@@ -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);