提交 f230e8ff 编写于 作者: M Michael Brunner 提交者: Linus Walleij

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: NJochen Henneberg <jh@henneberg-systemdesign.com>
Signed-off-by: NMichael Brunner <michael.brunner@kontron.com>
Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 6d86750c
...@@ -117,7 +117,7 @@ static int kempld_gpio_get_direction(struct gpio_chip *chip, unsigned offset) ...@@ -117,7 +117,7 @@ static int kempld_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
= container_of(chip, struct kempld_gpio_data, chip); = container_of(chip, struct kempld_gpio_data, chip);
struct kempld_device_data *pld = gpio->pld; 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) static int kempld_gpio_pincount(struct kempld_device_data *pld)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册