aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 78438d88d22a..b58b0de3c907 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -930,6 +930,8 @@ void peripheral_free(unsigned short per)
930 930
931 reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident); 931 reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);
932 932
933 set_label(ident, "free");
934
933 local_irq_restore(flags); 935 local_irq_restore(flags);
934} 936}
935EXPORT_SYMBOL(peripheral_free); 937EXPORT_SYMBOL(peripheral_free);
@@ -969,6 +971,17 @@ int gpio_request(unsigned short gpio, const char *label)
969 971
970 local_irq_save(flags); 972 local_irq_save(flags);
971 973
974 /*
975 * Allow that the identical GPIO can
976 * be requested from the same driver twice
977 * Do nothing and return -
978 */
979
980 if (cmp_label(gpio, label) == 0) {
981 local_irq_restore(flags);
982 return 0;
983 }
984
972 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 985 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
973 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n", 986 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n",
974 gpio, get_label(gpio)); 987 gpio, get_label(gpio));
@@ -1016,6 +1029,8 @@ void gpio_free(unsigned short gpio)
1016 1029
1017 reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); 1030 reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
1018 1031
1032 set_label(gpio, "free");
1033
1019 local_irq_restore(flags); 1034 local_irq_restore(flags);
1020} 1035}
1021EXPORT_SYMBOL(gpio_free); 1036EXPORT_SYMBOL(gpio_free);