Patchwork [U-Boot] gpio: imx: Fix return value on error

login
register
mail settings
Submitter Fabio Estevam
Date April 9, 2011, 8:43 p.m.
Message ID <1302381804-3416-1-git-send-email-festevam@gmail.com>
Download mbox | patch
Permalink /patch/90487/
State Accepted
Delegated to: Stefano Babic
Headers show

Comments

Fabio Estevam - April 9, 2011, 8:43 p.m.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/gpio/mxc_gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Stefano Babic - April 26, 2011, 5:47 a.m.
On 04/09/2011 10:43 PM, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/gpio/mxc_gpio.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 

The include for <asm/errno.h> was missing, I have added myself.

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Patch

diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index 53a0673..dcf114a 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -52,7 +52,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;
 
@@ -100,7 +100,7 @@  int mxc_gpio_get(unsigned int gpio)
 	u32 l;
 
 	if (port >= ARRAY_SIZE(gpio_ports))
-		return -1;
+		return -EINVAL;
 
 	gpio &= 0x1f;