diff mbox

[U-Boot,PATCH3/3] stm32: gpio_get_value: always return 0 or 1

Message ID 20160614062707.19763.15990.stgit@obelix.dresden.micronet24.de
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Benjamin Tietz June 14, 2016, 6:27 a.m. UTC
Previously, a set gpio had returned any power of 2. Some function check for 1 explicitly.
---
 drivers/gpio/stm32_gpio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Previously, a set gpio had returned any power of 2. Some function check for 1 explicitly.
---
 drivers/gpio/stm32_gpio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c
index d092c8f..516dfcc 100644
--- a/drivers/gpio/stm32_gpio.c
+++ b/drivers/gpio/stm32_gpio.c
@@ -263,7 +263,7 @@  int gpio_get_value(unsigned gpio)
 	dsc.port = stm32_gpio_to_port(gpio);
 	dsc.pin = stm32_gpio_to_pin(gpio);
 
-	return stm32_gpin_get(&dsc);
+	return !!stm32_gpin_get(&dsc);
 }
 
 int gpio_set_value(unsigned gpio, int value)