summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-01-08 13:15:45 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-01-08 13:15:45 +0100
commit79f38777947ac7685e2cef8bd977f954ab198c0e (patch)
tree6fe053ef751b1c424ec50be338844197b6421d74 /drivers/gpio
parent96764df1b47ddebfb50fadf5af72530b07b5fc89 (diff)
parent9bd5c1ad0db802c9f8d49d72b443f03431cf6a89 (diff)
downloadu-boot-imx-79f38777947ac7685e2cef8bd977f954ab198c0e.zip
u-boot-imx-79f38777947ac7685e2cef8bd977f954ab198c0e.tar.gz
u-boot-imx-79f38777947ac7685e2cef8bd977f954ab198c0e.tar.bz2
Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
This required manual merging drivers/mtd/nand/Makefile and adding am335x_evm support for CONFIG_SPL_NAND_DRIVERS
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/omap_gpio.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
index fc89f2a..a30d7f0 100644
--- a/drivers/gpio/omap_gpio.c
+++ b/drivers/gpio/omap_gpio.c
@@ -53,18 +53,14 @@ static inline int get_gpio_index(int gpio)
return gpio & 0x1f;
}
-static inline int gpio_valid(int gpio)
+int gpio_is_valid(int gpio)
{
- if (gpio < 0)
- return -1;
- if (gpio < 192)
- return 0;
- return -1;
+ return (gpio >= 0) && (gpio < 192);
}
static int check_gpio(int gpio)
{
- if (gpio_valid(gpio) < 0) {
+ if (!gpio_is_valid(gpio)) {
printf("ERROR : check_gpio: invalid GPIO %d\n", gpio);
return -1;
}