Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Hennerich and committed by
Bryan Wu
e1312bfc a6664875

+4 -1
+4 -1
arch/blackfin/include/asm/gpio.h
··· 303 303 304 304 static inline int gpio_to_irq(unsigned gpio) 305 305 { 306 - return (gpio + GPIO_IRQ_BASE); 306 + if (likely(gpio < MAX_BLACKFIN_GPIOS)) 307 + return gpio + GPIO_IRQ_BASE; 308 + 309 + return -EINVAL; 307 310 } 308 311 309 312 static inline int irq_to_gpio(unsigned irq)