aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-mxc/iomux-mx1-mx2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/plat-mxc/iomux-mx1-mx2.c b/arch/arm/plat-mxc/iomux-mx1-mx2.c
index a37163ce280b..25023ac2f53b 100644
--- a/arch/arm/plat-mxc/iomux-mx1-mx2.c
+++ b/arch/arm/plat-mxc/iomux-mx1-mx2.c
@@ -116,14 +116,16 @@ int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
116 int i; 116 int i;
117 unsigned gpio; 117 unsigned gpio;
118 unsigned mode; 118 unsigned mode;
119 int ret = -EINVAL; 119 int ret;
120 120
121 for (i = 0; i < count; i++) { 121 for (i = 0; i < count; i++) {
122 gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK); 122 gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK);
123 mode = *p & ~(GPIO_PIN_MASK | GPIO_PORT_MASK); 123 mode = *p & ~(GPIO_PIN_MASK | GPIO_PORT_MASK);
124 124
125 if (gpio >= (GPIO_PORT_MAX + 1) * 32) 125 if (gpio >= (GPIO_PORT_MAX + 1) * 32) {
126 ret = -EINVAL;
126 goto setup_error; 127 goto setup_error;
128 }
127 129
128 ret = gpio_request(gpio, label); 130 ret = gpio_request(gpio, label);
129 if (ret) 131 if (ret)