aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2011-04-09 10:43:24 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-05-11 23:03:15 +0200
commite53bcd947daaf6d6c05c545ddb734cb89fc40772 (patch)
tree0c4136f3a0a39b48a556577fdf6888f811c0c348 /drivers/gpio
parentb73850f7644db4f4c68f6efda43928a5be5a8534 (diff)
gpio: imx: Fix return value on error
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/mxc_gpio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index 103786209..6efbb02c1 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -24,6 +24,7 @@
#include <asm/arch/imx-regs.h>
#include <asm/io.h>
#include <mxc_gpio.h>
+#include <errno.h>
/* GPIO port description */
static unsigned long gpio_ports[] = {
@@ -47,7 +48,7 @@ int mxc_gpio_direction(unsigned int gpio, enum mxc_gpio_direction direction)
u32 l;
if (port >= ARRAY_SIZE(gpio_ports))
- return 1;
+ return -EINVAL;
gpio &= 0x1f;
@@ -95,7 +96,7 @@ int mxc_gpio_get(unsigned int gpio)
u32 l;
if (port >= ARRAY_SIZE(gpio_ports))
- return -1;
+ return -EINVAL;
gpio &= 0x1f;