]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
gpio: arizona: Correct check whether the pin is an input
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Wed, 19 Apr 2017 09:30:44 +0000 (10:30 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 24 Apr 2017 14:22:14 +0000 (16:22 +0200)
The logic to check if the pin is an input or output whilst testing if we
need to read the register value from the hardware or not is currently
inverted. Remove the erroneous not from the if statement.

Fixes: 11598d174050 ("gpio: arizona: Correct handling for reading input GPIOs")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-arizona.c

index 60b3102279f37736e3e5e77032deca7354060227..cd23fd727f9528abf56a178c8f10295943f41819 100644 (file)
@@ -51,7 +51,7 @@ static int arizona_gpio_get(struct gpio_chip *chip, unsigned offset)
                return ret;
 
        /* Resume to read actual registers for input pins */
-       if (!(val & ARIZONA_GPN_DIR)) {
+       if (val & ARIZONA_GPN_DIR) {
                ret = pm_runtime_get_sync(chip->parent);
                if (ret < 0) {
                        dev_err(chip->parent, "Failed to resume: %d\n", ret);