mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-27 22:51:31 +00:00
Blackfin arch: add a check to make sure only Blackfin GPIOs may generate IRQs
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
This commit is contained in:
parent
a66648756f
commit
e1312bfcc2
1 changed files with 4 additions and 1 deletions
|
@ -303,7 +303,10 @@ static inline void gpio_set_value(unsigned gpio, int value)
|
|||
|
||||
static inline int gpio_to_irq(unsigned gpio)
|
||||
{
|
||||
return (gpio + GPIO_IRQ_BASE);
|
||||
if (likely(gpio < MAX_BLACKFIN_GPIOS))
|
||||
return gpio + GPIO_IRQ_BASE;
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int irq_to_gpio(unsigned irq)
|
||||
|
|
Loading…
Reference in a new issue