diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2009-03-28 09:18:45 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-03-28 09:18:45 -0400 |
commit | e1312bfcc25f9301f997bf1ce84355a0f1167847 (patch) | |
tree | b9c11675d8abda4a53787443426f7b2ac743c4c9 /arch/blackfin | |
parent | a66648756f97ea5150875b85a0177c33e41afc1d (diff) |
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>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/include/asm/gpio.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index d4a082ef75b4..3c99ddc8df16 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h | |||
@@ -303,7 +303,10 @@ static inline void gpio_set_value(unsigned gpio, int value) | |||
303 | 303 | ||
304 | static inline int gpio_to_irq(unsigned gpio) | 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 | static inline int irq_to_gpio(unsigned irq) | 312 | static inline int irq_to_gpio(unsigned irq) |