diff options
authorMichael Brunner <>2015-05-11 12:46:49 +0200
committerGreg Kroah-Hartman <>2015-06-06 08:19:37 -0700
commitb66614bc2f03b43a7d646839276f8c4b27952295 (patch)
parenta3338cd9fae90c67ec12ca375b76764d6ffd11ef (diff)
gpio: gpio-kempld: Fix get_direction return value
commit f230e8ffc03f17bd9d6b90ea890b8252a8cc1821 upstream. This patch fixes an inverted return value of the gpio get_direction function. The wrong value causes the direction sysfs entry and GPIO debugfs file to indicate incorrect GPIO direction settings. In some cases it also prevents setting GPIO output values. The problem is also present in all other stable kernel versions since linux-3.12. Reported-by: Jochen Henneberg <> Signed-off-by: Michael Brunner <> Reviewed-by: Guenter Roeck <> Signed-off-by: Linus Walleij <> Signed-off-by: Greg Kroah-Hartman <>
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c
index c6d88173f5a2..fe6d4a135cab 100644
--- a/drivers/gpio/gpio-kempld.c
+++ b/drivers/gpio/gpio-kempld.c
@@ -117,7 +117,7 @@ static int kempld_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
= container_of(chip, struct kempld_gpio_data, chip);
struct kempld_device_data *pld = gpio->pld;
- return kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
+ return !kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
static int kempld_gpio_pincount(struct kempld_device_data *pld)