mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-08-24 06:06:17 -04:00
gpio: imx: Fix return value on error
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
This commit is contained in:
parent
b73850f764
commit
e53bcd947d
@ -24,6 +24,7 @@
|
|||||||
#include <asm/arch/imx-regs.h>
|
#include <asm/arch/imx-regs.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <mxc_gpio.h>
|
#include <mxc_gpio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
/* GPIO port description */
|
/* GPIO port description */
|
||||||
static unsigned long gpio_ports[] = {
|
static unsigned long gpio_ports[] = {
|
||||||
@ -47,7 +48,7 @@ int mxc_gpio_direction(unsigned int gpio, enum mxc_gpio_direction direction)
|
|||||||
u32 l;
|
u32 l;
|
||||||
|
|
||||||
if (port >= ARRAY_SIZE(gpio_ports))
|
if (port >= ARRAY_SIZE(gpio_ports))
|
||||||
return 1;
|
return -EINVAL;
|
||||||
|
|
||||||
gpio &= 0x1f;
|
gpio &= 0x1f;
|
||||||
|
|
||||||
@ -95,7 +96,7 @@ int mxc_gpio_get(unsigned int gpio)
|
|||||||
u32 l;
|
u32 l;
|
||||||
|
|
||||||
if (port >= ARRAY_SIZE(gpio_ports))
|
if (port >= ARRAY_SIZE(gpio_ports))
|
||||||
return -1;
|
return -EINVAL;
|
||||||
|
|
||||||
gpio &= 0x1f;
|
gpio &= 0x1f;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user