diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2010-02-03 20:19:00 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-02-04 09:33:10 +0100 |
commit | 5c17ef878fa25e04b1e8f1d8f5fa8b267753472c (patch) | |
tree | a1fc4038e4089712ae868a9b5b27fc992618e7f4 /arch/arm | |
parent | 1eaa4f2762899d2f3c54ba7a4fee564e255ad0a5 (diff) | |
download | kernel_samsung_aries-5c17ef878fa25e04b1e8f1d8f5fa8b267753472c.zip kernel_samsung_aries-5c17ef878fa25e04b1e8f1d8f5fa8b267753472c.tar.gz kernel_samsung_aries-5c17ef878fa25e04b1e8f1d8f5fa8b267753472c.tar.bz2 |
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')
-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 a37163c..25023ac 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, int i; unsigned gpio; unsigned mode; - int ret = -EINVAL; + int ret; for (i = 0; i < count; i++) { gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK); mode = *p & ~(GPIO_PIN_MASK | GPIO_PORT_MASK); - if (gpio >= (GPIO_PORT_MAX + 1) * 32) + if (gpio >= (GPIO_PORT_MAX + 1) * 32) { + ret = -EINVAL; goto setup_error; + } ret = gpio_request(gpio, label); if (ret) |