From: Adrian Hunter Date: Mon, 22 Sep 2014 08:01:16 +0000 (+0300) Subject: gpio: Fix gpio direction flags not getting set X-Git-Tag: v3.17-rc7~13^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72f908c88cef42b4ad486c39967fa4d7fdffce18;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git gpio: Fix gpio direction flags not getting set GPIO direction flags are not getting set because an 'if' statement is the wrong way around. Cc: Stable # 3.15+ Signed-off-by: Adrian Hunter Acked-by: Alexandre Courbot Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 15cc0bb..3b54edf 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -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 */