projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
afd46c5
)
gpio: altera_pio: fix get_value
author
Julien Béraud
<julien.beraud@orolia.com>
Mon, 7 Jan 2019 09:17:46 +0000
(09:17 +0000)
committer
Marek Vasut
<marex@denx.de>
Mon, 25 Feb 2019 15:07:36 +0000
(16:07 +0100)
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>
drivers/gpio/altera_pio.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/altera_pio.c
b/drivers/gpio/altera_pio.c
index 59e30979f0be117a47a60d84fbfcfe186302c8cd..324f9c29a82e5ba914ecbbb84825bc43d49c3735 100644
(file)
--- 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)
);
}