From e53bcd947daaf6d6c05c545ddb734cb89fc40772 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Sat, 9 Apr 2011 10:43:24 +0000 Subject: [PATCH] gpio: imx: Fix return value on error Signed-off-by: Fabio Estevam --- drivers/gpio/mxc_gpio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index 103786209c..6efbb02c16 100644 --- a/drivers/gpio/mxc_gpio.c +++ b/drivers/gpio/mxc_gpio.c @@ -24,6 +24,7 @@ #include #include #include +#include /* 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; -- 2.39.5