diff options
author | Nikita Kiryanov <nikita@compulab.co.il> | 2012-11-27 22:40:57 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-12-10 12:45:35 -0700 |
commit | dcee1ab3207327f142635b08e834af5e9f9f8cc9 (patch) | |
tree | 1e33d076024e6fa730215879954f28849103b296 /drivers | |
parent | abcbe2eb00dbb18d42bc505363115146c14a7ea0 (diff) | |
download | u-boot-imx-dcee1ab3207327f142635b08e834af5e9f9f8cc9.zip u-boot-imx-dcee1ab3207327f142635b08e834af5e9f9f8cc9.tar.gz u-boot-imx-dcee1ab3207327f142635b08e834af5e9f9f8cc9.tar.bz2 |
gpio: add gpio_is_valid() to omap_gpio API
Add gpio_is_valid() to omap_gpio API
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/omap_gpio.c | 10 |
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; } |