From: Holger Brunck Date: Sun, 21 Aug 2011 23:21:06 +0000 (+0000) Subject: kw_gpio: fix error in kw_gpio_direction_input X-Git-Tag: v2025.01-rc5-pxa1908~18800^2~37 X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/%7B%7B?a=commitdiff_plain;h=e5afdf584c1e217b19579ba88e415ff8eb657fd8;p=u-boot.git kw_gpio: fix error in kw_gpio_direction_input The function kw_gpio_is_valid returns zero on success, so adapt the error check accordingly. Signed-off-by: Holger Brunck cc: Prafulla Wadaskar cc: Dieter Kiermaier --- diff --git a/drivers/gpio/kw_gpio.c b/drivers/gpio/kw_gpio.c index 56383c2875..2de179e827 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. */