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>
This commit is contained in:
parent
a2d03a1d8e
commit
6a87d29bc6
1 changed files with 5 additions and 5 deletions
|
@ -881,13 +881,13 @@ int peripheral_request(unsigned short per, const char *label)
|
||||||
if (!(per & P_DEFINED))
|
if (!(per & P_DEFINED))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
if (check_gpio(ident))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
|
|
||||||
/* Can't do GPIO and peripheral at the same time */
|
/* If a pin can be muxed as either GPIO or peripheral, make
|
||||||
if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
|
* 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();
|
dump_stack();
|
||||||
printk(KERN_ERR
|
printk(KERN_ERR
|
||||||
"%s: Peripheral %d is already reserved as GPIO by %s !\n",
|
"%s: Peripheral %d is already reserved as GPIO by %s !\n",
|
||||||
|
|
Loading…
Add table
Reference in a new issue