[PATCH 6/7] gpio: of: Fix logic inversion

Ike Panhc ike.pan at canonical.com
Fri May 24 06:48:19 UTC 2019


From: Linus Walleij <linus.walleij at linaro.org>

BugLink: https://bugs.launchpad.net/bugs/1826142

The SPI chip selects were not properly inspected due to
a logic inversion. This made SPI GPIOs not work.

Cc: Jan Kotas <jank at cadence.com>
Reported-by: Jan Kotas <jank at cadence.com>
Tested-by: Jan Kotas <jank at cadence.com>
Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
Signed-off-by: Mark Brown <broonie at kernel.org>
(cherry picked from commit c1c04cea13dc234ce9a4504879ddd36ea524d880)
Signed-off-by: Ike Panhc <ike.pan at canonical.com>
---
 drivers/gpio/gpiolib-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index a1dd2f1c0d02..ea257dec8bf6 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -126,7 +126,7 @@ static void of_gpio_flags_quirks(struct device_node *np,
 
 		for_each_child_of_node(np, child) {
 			ret = of_property_read_u32(child, "reg", &cs);
-			if (!ret)
+			if (ret)
 				continue;
 			if (cs == index) {
 				/*
-- 
2.17.1




More information about the kernel-team mailing list