summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-tc3589x.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-11-14 15:10:29 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-11-15 10:33:30 +0100
commit220a04f0e53276eb3da666174bcf97489fd8644e (patch)
treee15a4ae34b8d4060c4fd5fbb6d44b9fa37e6a2d3 /drivers/gpio/gpio-tc3589x.c
parent60f8339eb388df8a46f8eb4282ff0e15f08f218c (diff)
downloadlinux-stable-220a04f0e53276eb3da666174bcf97489fd8644e.tar.gz
linux-stable-220a04f0e53276eb3da666174bcf97489fd8644e.tar.bz2
linux-stable-220a04f0e53276eb3da666174bcf97489fd8644e.zip
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. Cc: stable@vger.kernel.org Fixes: 14063d71e5e6 ("gpio: tc3589x: add .get_direction() and small cleanup") Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-tc3589x.c')
-rw-r--r--drivers/gpio/gpio-tc3589x.c2
1 files changed, 1 insertions, 1 deletions
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,