9
0
Fork 0

gpio-davinci: gpio get should return 0 or 1

Returning other values causes problems for client code which wants to
perform calculations with the returned value.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jan Luebbe 2015-05-30 14:57:49 +02:00 committed by Sascha Hauer
parent 6792d94a4b
commit 9bf7d3b281
1 changed files with 1 additions and 1 deletions

View File

@ -117,7 +117,7 @@ static int davinci_gpio_get(struct gpio_chip *chip, unsigned offset)
struct davinci_gpio_controller *d = chip2controller(chip);
struct davinci_gpio_regs __iomem *g = d->regs;
return (1 << offset) & readl_relaxed(&g->in_data);
return ((1 << offset) & readl_relaxed(&g->in_data)) ? 1 : 0;
}
/*