diff options
author | Julien BĂ©raud <julien.beraud@orolia.com> | 2019-01-07 09:17:46 +0000 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2019-02-25 16:07:36 +0100 |
commit | 97b262758b7c99a644155254bee9f716573b10ac (patch) | |
tree | d1ae93488b0694fe0574ac5571ea43176080f005 /drivers/gpio | |
parent | afd46c5f13d0c93c44008bd7040227d0b84e31b9 (diff) |
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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/altera_pio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/altera_pio.c b/drivers/gpio/altera_pio.c index 59e30979f0b..324f9c29a82 100644 --- a/drivers/gpio/altera_pio.c +++ b/drivers/gpio/altera_pio.c @@ -56,7 +56,7 @@ static int altera_pio_get_value(struct udevice *dev, unsigned pin) 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)); } |