提交 e1312bfc 编写于 作者: M Michael Hennerich 提交者: Bryan Wu

Blackfin arch: add a check to make sure only Blackfin GPIOs may generate IRQs

Signed-off-by: NMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: NBryan Wu <cooloney@kernel.org>
上级 a6664875
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册