mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-29 10:01:43 +00:00
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>
This commit is contained in:
parent
afd46c5f13
commit
97b262758b
1 changed files with 1 additions and 1 deletions
|
@ -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_platdata *plat = dev_get_platdata(dev);
|
||||||
struct altera_pio_regs *const regs = plat->regs;
|
struct altera_pio_regs *const regs = plat->regs;
|
||||||
|
|
||||||
return readl(®s->data) & (1 << pin);
|
return !!(readl(®s->data) & (1 << pin));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue