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>
This commit is contained in:
Jan Luebbe 2015-05-30 14:21:17 +02:00
parent b0a31f0e22
commit d9b09a9a43
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;
}
/*