[U-Boot] [PATCH] kw_gpio: fix error in kw_gpio_direction_input

Holger Brunck holger.brunck at keymile.com
Mon Aug 22 11:21:06 CEST 2011


The function kw_gpio_is_valid returns zero on success, so
adapt the error check accordingly.

Signed-off-by: Holger Brunck <holger.brunck at keymile.com>
cc: Prafulla Wadaskar <prafulla at marvell.com>
cc: Dieter Kiermaier <dk-arm-linux at gmx.de>
---
 drivers/gpio/kw_gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/kw_gpio.c b/drivers/gpio/kw_gpio.c
index 56383c2..2de179e 100644
--- a/drivers/gpio/kw_gpio.c
+++ b/drivers/gpio/kw_gpio.c
@@ -109,7 +109,7 @@ void kw_gpio_set_valid(unsigned pin, int mode)
  */
 int kw_gpio_direction_input(unsigned pin)
 {
-	if (!kw_gpio_is_valid(pin, GPIO_INPUT_OK))
+	if (kw_gpio_is_valid(pin, GPIO_INPUT_OK) != 0)
 		return 1;
 
 	/* Configure GPIO direction. */
-- 
1.7.1



More information about the U-Boot mailing list