diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-10-28 15:53:37 +0800 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-10-28 15:53:37 +0800 |
commit | a2d03a1d8e2562cc64a223485c06db9840ac3b2b (patch) | |
tree | 0586b73032e9e23533d9b6dc73368fa0d826db35 /arch/blackfin/kernel/bfin_gpio.c | |
parent | 6c7ec0ec93d3f8e661a1d11221d869654dd3fcd9 (diff) | |
download | kernel_samsung_crespo-a2d03a1d8e2562cc64a223485c06db9840ac3b2b.zip kernel_samsung_crespo-a2d03a1d8e2562cc64a223485c06db9840ac3b2b.tar.gz kernel_samsung_crespo-a2d03a1d8e2562cc64a223485c06db9840ac3b2b.tar.bz2 |
Blackfin arch: unify port_setup() to reduce arch differences
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/bfin_gpio.c')
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 8d12853..9609026 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c @@ -261,29 +261,25 @@ static int cmp_label(unsigned short ident, const char *label) return -EINVAL; } -#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) static void port_setup(unsigned gpio, unsigned short usage) { - if (!check_gpio(gpio)) { - if (usage == GPIO_USAGE) - *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); - else - *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); - SSYNC(); - } -} + if (check_gpio(gpio)) + return; + +#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) + if (usage == GPIO_USAGE) + *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); + else + *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); + SSYNC(); #elif defined(BF548_FAMILY) -static void port_setup(unsigned gpio, unsigned short usage) -{ if (usage == GPIO_USAGE) gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); else gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio); SSYNC(); -} -#else -# define port_setup(...) do { } while (0) #endif +} #ifdef BF537_FAMILY static struct { |