Skip to contentSkip to conversation

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

PATCH In review Charles Keepax 2 participants 2 messages Apr 19, 2017 – Apr 24, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 11598d174050 ("gpio: arizona: Correct handling for reading input GPIOs")
---
 drivers/gpio/gpio-arizona.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-arizona.c +1 -1
index 60b3102..cd23fd7 100644
@@ -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);
Signature · 1 line
2.1.4
#1 lore raw
Quoted 6 lines · Charles Keepax

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")

Patch applied.

Yours,
Linus Walleij