mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-08 03:23:32 -04:00
Blackfin: gpio: optimize free path a little
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>
This commit is contained in:
parent
272d2fc2f5
commit
95b4b9d97a
@ -665,6 +665,7 @@ int bfin_gpio_request(unsigned gpio, const char *label)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_BFIN_GPIO_TRACK
|
||||||
void bfin_gpio_free(unsigned gpio)
|
void bfin_gpio_free(unsigned gpio)
|
||||||
{
|
{
|
||||||
if (check_gpio(gpio) < 0)
|
if (check_gpio(gpio) < 0)
|
||||||
@ -679,6 +680,7 @@ void bfin_gpio_free(unsigned gpio)
|
|||||||
|
|
||||||
set_label(gpio, "free");
|
set_label(gpio, "free");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BFIN_SPECIAL_GPIO_BANKS
|
#ifdef BFIN_SPECIAL_GPIO_BANKS
|
||||||
DECLARE_RESERVED_MAP(special_gpio, gpio_bank(MAX_RESOURCES));
|
DECLARE_RESERVED_MAP(special_gpio, gpio_bank(MAX_RESOURCES));
|
||||||
|
@ -142,8 +142,10 @@ struct gpio_port_t {
|
|||||||
|
|
||||||
#ifdef CONFIG_BFIN_GPIO_TRACK
|
#ifdef CONFIG_BFIN_GPIO_TRACK
|
||||||
void bfin_gpio_labels(void);
|
void bfin_gpio_labels(void);
|
||||||
|
void bfin_gpio_free(unsigned gpio);
|
||||||
#else
|
#else
|
||||||
#define bfin_gpio_labels()
|
#define bfin_gpio_labels()
|
||||||
|
#define bfin_gpio_free(gpio)
|
||||||
#define bfin_gpio_request(gpio, label) bfin_gpio_request(gpio)
|
#define bfin_gpio_request(gpio, label) bfin_gpio_request(gpio)
|
||||||
#define bfin_special_gpio_request(gpio, label) bfin_special_gpio_request(gpio)
|
#define bfin_special_gpio_request(gpio, label) bfin_special_gpio_request(gpio)
|
||||||
#endif
|
#endif
|
||||||
@ -154,7 +156,6 @@ int bfin_special_gpio_request(unsigned gpio, const char *label);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int bfin_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_input(unsigned gpio);
|
||||||
int bfin_gpio_direction_output(unsigned gpio, int value);
|
int bfin_gpio_direction_output(unsigned gpio, int value);
|
||||||
int bfin_gpio_get_value(unsigned gpio);
|
int bfin_gpio_get_value(unsigned gpio);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user