From 9bf7d3b281c3a8ff344dfcbac5c73f6a2938ec58 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Sat, 30 May 2015 14:57:49 +0200 Subject: 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 Signed-off-by: Sascha Hauer --- drivers/gpio/gpio-davinci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpio') diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 2b1d82b71c..61c6e7e68c 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -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; } /* -- cgit v1.2.3