diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2010-02-03 14:19:00 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-02-04 03:33:10 -0500 |
commit | 5c17ef878fa25e04b1e8f1d8f5fa8b267753472c (patch) | |
tree | a1fc4038e4089712ae868a9b5b27fc992618e7f4 /arch/arm/plat-mxc | |
parent | 1eaa4f2762899d2f3c54ba7a4fee564e255ad0a5 (diff) |
MX1/MX2: -EINVAL overwritten in second iteration in mxc_gpio_setup_multiple_pins()
Due to the `ret = gpio_request()' below in the loop, the initial -EINVAL value
of ret is overwritten.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/iomux-mx1-mx2.c | 6 |
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 a37163ce280..25023ac2f53 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) |