Skip to content

Commit

Permalink
gpio: arizona: Correct check whether the pin is an input
Browse files Browse the repository at this point in the history
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: 11598d1 ("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>
  • Loading branch information
Charles Keepax authored and Linus Walleij committed Apr 24, 2017
1 parent 42fcb20 commit 64c6a71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 64c6a71

Please sign in to comment.