aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-10-28 03:45:42 -0400
committerBryan Wu <cooloney@kernel.org>2008-10-28 03:45:42 -0400
commit27228b2e4c1726a376b32f8b12242718ebf5b8a4 (patch)
tree9625f0ad9a0ab0d1468fd46ef474d20400aa78fd
parent588ba8199e06e4d558114093d0b5812920035c72 (diff)
Blackfin arch: unify check_gpio() to reduce arch differences
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 5556e13993bf..a808baf5d309 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -216,24 +216,18 @@ static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG0_INT
216#endif 216#endif
217#endif /* CONFIG_PM */ 217#endif /* CONFIG_PM */
218 218
219#if defined(BF548_FAMILY)
220inline int check_gpio(unsigned gpio) 219inline int check_gpio(unsigned gpio)
221{ 220{
221#if defined(BF548_FAMILY)
222 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 222 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
223 || gpio == GPIO_PH14 || gpio == GPIO_PH15 223 || gpio == GPIO_PH14 || gpio == GPIO_PH15
224 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 224 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15)
225 || gpio >= MAX_BLACKFIN_GPIOS)
226 return -EINVAL; 225 return -EINVAL;
227 return 0; 226#endif
228}
229#else
230inline int check_gpio(unsigned gpio)
231{
232 if (gpio >= MAX_BLACKFIN_GPIOS) 227 if (gpio >= MAX_BLACKFIN_GPIOS)
233 return -EINVAL; 228 return -EINVAL;
234 return 0; 229 return 0;
235} 230}
236#endif
237 231
238static void gpio_error(unsigned gpio) 232static void gpio_error(unsigned gpio)
239{ 233{