summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-kempld.c
diff options
context:
space:
mode:
authorMichael Brunner <mibru@gmx.de>2015-05-11 06:46:49 -0400
committerLinus Walleij <linus.walleij@linaro.org>2015-05-12 07:49:13 -0400
commitf230e8ffc03f17bd9d6b90ea890b8252a8cc1821 (patch)
tree0ed91fda8c78725fa92634a3128f3cf8ba159fd8 /drivers/gpio/gpio-kempld.c
parent6d86750ce62391f5a0a7985d5c050c2e3c823ab9 (diff)
gpio: gpio-kempld: Fix get_direction return value
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. Cc: Stable <stable@vger.kernel.org> # v3.12+ Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com> Signed-off-by: Michael Brunner <michael.brunner@kontron.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-kempld.c')
-rw-r--r--drivers/gpio/gpio-kempld.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c
index 6b8115f34208..83f281dda1e0 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)
117 = container_of(chip, struct kempld_gpio_data, chip); 117 = container_of(chip, struct kempld_gpio_data, chip);
118 struct kempld_device_data *pld = gpio->pld; 118 struct kempld_device_data *pld = gpio->pld;
119 119
120 return kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset); 120 return !kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
121} 121}
122 122
123static int kempld_gpio_pincount(struct kempld_device_data *pld) 123static int kempld_gpio_pincount(struct kempld_device_data *pld)