gpio: altera_pio: fix get_value
gpio_get_value should return 0 or 1, not the value of bit & (1 << pin)
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Julien Beraud <julien.beraud@orolia.com>
diff --git a/drivers/gpio/altera_pio.c b/drivers/gpio/altera_pio.c
index 59e3097..324f9c2 100644
--- a/drivers/gpio/altera_pio.c
+++ b/drivers/gpio/altera_pio.c
@@ -56,7 +56,7 @@
struct altera_pio_platdata *plat = dev_get_platdata(dev);
struct altera_pio_regs *const regs = plat->regs;
- return readl(®s->data) & (1 << pin);
+ return !!(readl(®s->data) & (1 << pin));
}