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

ARM: OMAP: GPIO: fix MPUIO check

- MPUIO doesn't exist on OMAP2
- no error was returned for too big MPUIO numbers

Signed-off-by: Imre Deak <imre.deak@solidboot.com>
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by

Imre Deak and committed by
Tony Lindgren
5a4e86da 0e0a1986

+3 -3
+3 -3
arch/arm/plat-omap/gpio.c
··· 110 110 #define OMAP24XX_GPIO_CLEARDATAOUT 0x0090 111 111 #define OMAP24XX_GPIO_SETDATAOUT 0x0094 112 112 113 - #define OMAP_MPUIO_MASK (~OMAP_MAX_GPIO_LINES & 0xff) 114 - 115 113 struct gpio_bank { 116 114 void __iomem *base; 117 115 u16 irq; ··· 214 216 { 215 217 if (gpio < 0) 216 218 return -1; 219 + #ifndef CONFIG_ARCH_OMAP24XX 217 220 if (OMAP_GPIO_IS_MPUIO(gpio)) { 218 - if ((gpio & OMAP_MPUIO_MASK) > 16) 221 + if (gpio >= MAX_GPIO_LINES + 16) 219 222 return -1; 220 223 return 0; 221 224 } 225 + #endif 222 226 #ifdef CONFIG_ARCH_OMAP15XX 223 227 if (cpu_is_omap15xx() && gpio < 16) 224 228 return 0;