We need to return the corresponding bit (0 or 1) for a particular GPIO.
Signed-off-by: Markus Mayer <[email protected]>
Reviewed-by: Tim Kryger <[email protected]>
---
Without this change, the driver doesn't work in all cases as it should.
drivers/gpio/gpio-bcm-kona.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index 72c927d..db473f1 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -158,7 +158,7 @@ static int bcm_kona_gpio_get(struct gpio_chip *chip,
unsigned gpio)
spin_unlock_irqrestore(&kona_gpio->lock, flags);
/* return the specified bit status */
- return !!(val & bit);
+ return (val >> bit) & 1;
}
static int bcm_kona_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html