From: Markus Mayer Date: Thu, 21 Nov 2013 23:12:46 +0000 (-0800) Subject: gpio: bcm281xx: Fix return value of bcm_kona_gpio_get() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e2f0b00560729c47f39b2bc624eb93d82dc0e3e8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git gpio: bcm281xx: Fix return value of bcm_kona_gpio_get() We need to return the corresponding bit for a particular GPIO. This bit contains shift not mask. Signed-off-by: Markus Mayer Reviewed-by: Tim Kryger Reviewed-by: Matt Porter Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index 72c927dc3be1..54c18c220a60 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(bit)); } static int bcm_kona_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)