diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2007-10-03 12:36:18 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-10-03 12:36:18 -0400 |
commit | cda6a20b68c1f21f4b4bc9cd3ee08494e7ebf0d5 (patch) | |
tree | 138cf053600bdf22dea762e8bc2b6e7bc27b64eb /arch/blackfin | |
parent | c58c2140f08de4ad0b0dbd48f6e78168dc321042 (diff) |
Blackfin arch: fix PORT_J BUG for BF537/6 EMAC driver reported by Kalle Pokki <kalle.pokki@iki.fi>
Cc: Kalle Pokki <kalle.pokki@iki.fi>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 9f309480024..5d488ef965c 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c | |||
@@ -180,11 +180,13 @@ static int cmp_label(unsigned short ident, const char *label) | |||
180 | #ifdef BF537_FAMILY | 180 | #ifdef BF537_FAMILY |
181 | static void port_setup(unsigned short gpio, unsigned short usage) | 181 | static void port_setup(unsigned short gpio, unsigned short usage) |
182 | { | 182 | { |
183 | if (usage == GPIO_USAGE) { | 183 | if (!check_gpio(gpio)) { |
184 | *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); | 184 | if (usage == GPIO_USAGE) { |
185 | } else | 185 | *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); |
186 | *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); | 186 | } else |
187 | SSYNC(); | 187 | *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); |
188 | SSYNC(); | ||
189 | } | ||
188 | } | 190 | } |
189 | #else | 191 | #else |
190 | # define port_setup(...) do { } while (0) | 192 | # define port_setup(...) do { } while (0) |
@@ -644,11 +646,10 @@ int peripheral_request(unsigned short per, const char *label) | |||
644 | if (!(per & P_DEFINED)) | 646 | if (!(per & P_DEFINED)) |
645 | return -ENODEV; | 647 | return -ENODEV; |
646 | 648 | ||
647 | if (check_gpio(ident) < 0) | ||
648 | return -EINVAL; | ||
649 | |||
650 | local_irq_save(flags); | 649 | local_irq_save(flags); |
651 | 650 | ||
651 | if (!check_gpio(ident)) { | ||
652 | |||
652 | if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) { | 653 | if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) { |
653 | printk(KERN_ERR | 654 | printk(KERN_ERR |
654 | "%s: Peripheral %d is already reserved as GPIO by %s !\n", | 655 | "%s: Peripheral %d is already reserved as GPIO by %s !\n", |
@@ -658,6 +659,8 @@ int peripheral_request(unsigned short per, const char *label) | |||
658 | return -EBUSY; | 659 | return -EBUSY; |
659 | } | 660 | } |
660 | 661 | ||
662 | } | ||
663 | |||
661 | if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) { | 664 | if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) { |
662 | 665 | ||
663 | /* | 666 | /* |