Skip to content

Commit

Permalink
Blackfin arch: add a check to make sure only Blackfin GPIOs may gener…
Browse files Browse the repository at this point in the history
…ate IRQs

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Michael Hennerich authored and Bryan Wu committed Mar 28, 2009
1 parent a666487 commit e1312bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/blackfin/include/asm/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e1312bf

Please sign in to comment.