From: Fabio Estevam Date: Sat, 9 Apr 2011 10:43:24 +0000 (+0000) Subject: gpio: imx: Fix return value on error X-Git-Tag: v2011.06-rc1~66^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e53bcd947daaf6d6c05c545ddb734cb89fc40772;p=kernel%2Fu-boot.git gpio: imx: Fix return value on error Signed-off-by: Fabio Estevam --- diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index 1037862..6efbb02 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;