Skip to contentSkip to conversation

gpio: imx: Fix return value on error

PATCH New Fabio Estevam 2 participants 2 messages Apr 9, 2011 – Apr 26, 2011

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 gpio: imx: Fix return value on error

---
 drivers/gpio/mxc_gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/mxc_gpio.c +2 -2
index 53a0673..dcf114a 100644
@@ -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;
 
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 gpio: imx: Fix return value on error

Quoted 5 lines · Fabio Estevam
---
 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

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================