summaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-10-28 09:16:29 +0100
committerBryan Wu <cooloney@kernel.org>2008-10-28 09:16:29 +0100
commit6a87d29bc684d845fe8338a8ce279f743d343250 (patch)
treec2ea737e052787f940a8a012974213d619d498d2 /arch/blackfin
parentBlackfin arch: unify port_setup() to reduce arch differences (diff)
downloadlinux-6a87d29bc684d845fe8338a8ce279f743d343250.tar.xz
linux-6a87d29bc684d845fe8338a8ce279f743d343250.zip
Blackfin arch: refine the gpio check
refine the gpio check in peripheral_request() so that it only checks pins that can be used as both GPIO and a peripheral Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 96090268e007..3e698d651f17 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -881,13 +881,13 @@ int peripheral_request(unsigned short per, const char *label)
if (!(per & P_DEFINED))
return -ENODEV;
- if (check_gpio(ident))
- return -EINVAL;
-
local_irq_save(flags);
- /* Can't do GPIO and peripheral at the same time */
- if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
+ /* If a pin can be muxed as either GPIO or peripheral, make
+ * sure it is not already a GPIO pin when we request it.
+ */
+ if (unlikely(!check_gpio(ident) &&
+ reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
dump_stack();
printk(KERN_ERR
"%s: Peripheral %d is already reserved as GPIO by %s !\n",