gpio: Fix gpio direction flags not getting set
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 22 Sep 2014 08:01:16 +0000 (11:01 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 24 Sep 2014 07:47:12 +0000 (09:47 +0200)
GPIO direction flags are not getting set because
an 'if' statement is the wrong way around.

Cc: Stable <stable@vger.kernel.org> # 3.15+
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c

index 15cc0bb..3b54edf 100644 (file)
@@ -1674,7 +1674,7 @@ struct gpio_desc *__must_check __gpiod_get_index(struct device *dev,
                set_bit(FLAG_OPEN_SOURCE, &desc->flags);
 
        /* No particular flag request, return here... */
-       if (flags & GPIOD_FLAGS_BIT_DIR_SET)
+       if (!(flags & GPIOD_FLAGS_BIT_DIR_SET))
                return desc;
 
        /* Process flags */