gpio: altera_pio: fix get_value
PATCH v3 1/1 gpio: altera_pio: fix get_value
gpio_get_value should return 0 or 1, not the value of bit & (1 << pin)
--- drivers/gpio/altera_pio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/altera_pio.c +1 -1
@@ -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)); }
Signature · 1 line
2.20.1
PATCH v3 1/1 gpio: altera_pio: fix get_value
Quoted 4 lines · Julien Béraud
gpio_get_valueshould return 0 or 1, not the value of bit & (1 << pin)Acked-by Marek Vasut <[email protected]>Signed-off-by Julien Beraud <[email protected]>
btw. you should keep a changelog with each new Vx of a patch. Here it's fine, just add one next time you submit patches.
Quoted 18 lines
--- drivers/gpio/altera_pio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpio/altera_pio.c +1
-1@@ -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)); }
Signature · 2 lines
Best regards, Marek Vasut
PATCH v3 1/1 gpio: altera_pio: fix get_value
Quoted 2 lines · Marek Vasut
btw. you should keep a changelog with each new Vx of a patch. Here it's fine, just add one next time you submit patches.
Sure, I'll do it next time. Thanks.
Julien
PATCH v3 1/1 gpio: altera_pio: fix get_value
Quoted 8 lines · Julien Beraud
Quoted 2 lines · Marek Vasut
btw. you should keep a changelog with each new Vx of a patch. Here it's fine, just add one next time you submit patches.
Sure, I'll do it next time. Thanks.
Julien
Hi Marek,
I can see on https://patchwork.ozlabs.org/patch/1021221/ that the patch has been delegated to you. Though I assume you were thinking someone else would apply, may I ask you to apply it ?
Regards,
Julien
Marek Vasut
AppliedPATCH v3 1/1 gpio: altera_pio: fix get_value
Quoted 9 lines · Julien Béraud
Quoted 7 lines · Julien Beraud
Quoted 2 lines · Marek Vasut
btw. you should keep a changelog with each new Vx of a patch. Here it's fine, just add one next time you submit patches.
Sure, I'll do it next time. Thanks.
Quoted 7 lines
Quoted 1 line
Julien
Hi Marek,
I can see on https://patchwork.ozlabs.org/patch/1021221/ that the patch has been delegated to you. Though I assume you were thinking someone else would apply, may I ask you to apply it ?
Applied, thanks for the reminder
Signature · 2 lines
Best regards, Marek Vasut