Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1312bfc authored by Michael Hennerich's avatar Michael Hennerich Committed by Bryan Wu
Browse files

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

parent a6664875
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)