diff options
Diffstat (limited to 'arch/blackfin/include/asm/gpio.h')
-rw-r--r-- | arch/blackfin/include/asm/gpio.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index d4a082ef75b4..fe139619351f 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h | |||
@@ -110,7 +110,7 @@ | |||
110 | * MODIFICATION HISTORY : | 110 | * MODIFICATION HISTORY : |
111 | **************************************************************/ | 111 | **************************************************************/ |
112 | 112 | ||
113 | #ifndef BF548_FAMILY | 113 | #ifndef CONFIG_BF54x |
114 | void set_gpio_dir(unsigned, unsigned short); | 114 | void set_gpio_dir(unsigned, unsigned short); |
115 | void set_gpio_inen(unsigned, unsigned short); | 115 | void set_gpio_inen(unsigned, unsigned short); |
116 | void set_gpio_polar(unsigned, unsigned short); | 116 | void set_gpio_polar(unsigned, unsigned short); |
@@ -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) |