gpio: of: Fix logic inversion
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 16 Jan 2019 08:21:10 +0000 (09:21 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 24 Jan 2019 19:03:25 +0000 (19:03 +0000)
The SPI chip selects were not properly inspected due to
a logic inversion. This made SPI GPIOs not work.

Cc: Jan Kotas <jank@cadence.com>
Reported-by: Jan Kotas <jank@cadence.com>
Tested-by: Jan Kotas <jank@cadence.com>
Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/gpio/gpiolib-of.c

index a6e1891217e26880cb94bd2ec6b08289733f8c42..c34eb9d9c59a0d2e30bb3388eb5e96a983ae76a6 100644 (file)
@@ -125,7 +125,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) {
                                /*