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:
parent
6792d94a4b
commit
9bf7d3b281
|
@ -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_controller *d = chip2controller(chip);
|
||||||
struct davinci_gpio_regs __iomem *g = d->regs;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue