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

Submitted by Charles Keepax on April 19, 2017, 9:30 a.m.

Details

Message ID 1492594244-27361-1-git-send-email-ckeepax@opensource.wolfsonmicro.com
State New
Headers show

Commit Message

Charles Keepax April 19, 2017, 9:30 a.m.
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>
---
 drivers/gpio/gpio-arizona.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij April 24, 2017, 2:22 p.m.
On Wed, Apr 19, 2017 at 11:30 AM, Charles Keepax
<ckeepax@opensource.wolfsonmicro.com> wrote:

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

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index 60b3102..cd23fd7 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -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);