1
0
Fork 0

gpio: arizona: Correct check whether the pin is an input

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: 11598d1740 ("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>
hifive-unleashed-5.1
Charles Keepax 2017-04-19 10:30:44 +01:00 committed by Linus Walleij
parent 42fcb203e3
commit 64c6a71126
1 changed files with 1 additions and 1 deletions

View 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);