Linux Kernels

gpio: tc3589x: fix up .get_direction()

This change “gpio: tc3589x: fix up .get_direction()” (commit 220a04f) in Linux kernel is authored by Linus Walleij <linus.walleij [at]> on Mon Nov 14 15:10:29 2016 +0100.

Description of "gpio: tc3589x: fix up .get_direction()"

The change “gpio: tc3589x: fix up .get_direction()” introduces changes as follows.

gpio: tc3589x: fix up .get_direction()

The bit in the TC3589x direction register is 0 for input
and 1 for output, but the gpiolib expects the reverse.
Fix up the logic.

Fixes: 14063d71e5e6 ("gpio: tc3589x: add .get_direction() and small cleanup")
Signed-off-by: Linus Walleij <>

Linux kernel releases containing commit 220a04f

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "gpio: tc3589x: fix up .get_direction()"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/gpio/gpio-tc3589x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 5a5a6cb00eea..d6e21f1a70a9 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -97,7 +97,7 @@ static int tc3589x_gpio_get_direction(struct gpio_chip *chip,
 	if (ret < 0)
 		return ret;
-	return !!(ret & BIT(pos));
+	return !(ret & BIT(pos));
 static int tc3589x_gpio_set_single_ended(struct gpio_chip *chip,

The commit for this change in Linux stable tree is 220a04f (patch).

Last modified: 2020/01/11 09:36