Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66019
b: refs/heads/master
c: 2acde90
h: refs/heads/master
i:
  66017: d34cb4b
  66015: abb1073
v: v3
  • Loading branch information
Michael Hennerich authored and Bryan Wu committed Oct 10, 2007
1 parent c8df156 commit d1a7bfc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55249e9e3d07617e00cc6c52b83f7d1a7eb7e64d
refs/heads/master: 2acde902301f73e824101e5ca9eb95dc733dc17d
15 changes: 15 additions & 0 deletions trunk/arch/blackfin/kernel/bfin_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,8 @@ void peripheral_free(unsigned short per)

reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);

set_label(ident, "free");

local_irq_restore(flags);
}
EXPORT_SYMBOL(peripheral_free);
Expand Down Expand Up @@ -969,6 +971,17 @@ int gpio_request(unsigned short gpio, const char *label)

local_irq_save(flags);

/*
* Allow that the identical GPIO can
* be requested from the same driver twice
* Do nothing and return -
*/

if (cmp_label(gpio, label) == 0) {
local_irq_restore(flags);
return 0;
}

if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n",
gpio, get_label(gpio));
Expand Down Expand Up @@ -1016,6 +1029,8 @@ void gpio_free(unsigned short gpio)

reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);

set_label(gpio, "free");

local_irq_restore(flags);
}
EXPORT_SYMBOL(gpio_free);
Expand Down

0 comments on commit d1a7bfc

Please sign in to comment.