diff mbox

[1/4] mmc: slot-gpio: switch to use flags when getting GPIO

Message ID 541FDBC0.4020302@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Adrian Hunter Sept. 22, 2014, 8:20 a.m. UTC
On 08/29/2014 03:16 PM, Ulf Hansson wrote:
> On 27 August 2014 13:00, Linus Walleij <linus.walleij@linaro.org> wrote:
>> When the slot GPIO driver gets the GPIO to be used for card
>> detect, it is now possible to specify a flag to have the line
>> set up as input. Get rid of the explicit setup call for input
>> and use the flag.
>>
>> The extra argument works as there are transition varargs
>> macros in place in the <linux/gpio/consumer.h> header, in
>> the future we will make the flags argument compulsory.
>>
>> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Thanks! Applied for next.

Unfortunately it doesn't seem to work.  I needed the patch
below.


From: Adrian Hunter <adrian.hunter@intel.com>
Date: Mon, 22 Sep 2014 11:01:16 +0300
Subject: [PATCH] gpio: Fix gpio direction flags not getting set

GPIO direction flags are not getting set because
an 'if' statement is the wrong way around.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Sept. 22, 2014, 12:37 p.m. UTC | #1
On Mon, Sep 22, 2014 at 10:20 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:

> Unfortunately it doesn't seem to work.  I needed the patch
> below.
>
>
> From: Adrian Hunter <adrian.hunter@intel.com>
> Date: Mon, 22 Sep 2014 11:01:16 +0300
> Subject: [PATCH] gpio: Fix gpio direction flags not getting set
>
> GPIO direction flags are not getting set because
> an 'if' statement is the wrong way around.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

Oopps that's a bug, patch applied for fixes, so it'll work when
this hits upstream.

Alex: confirm?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexandre Courbot Sept. 24, 2014, 7:38 a.m. UTC | #2
On Mon, Sep 22, 2014 at 9:37 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Sep 22, 2014 at 10:20 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:
>
>> Unfortunately it doesn't seem to work.  I needed the patch
>> below.
>>
>>
>> From: Adrian Hunter <adrian.hunter@intel.com>
>> Date: Mon, 22 Sep 2014 11:01:16 +0300
>> Subject: [PATCH] gpio: Fix gpio direction flags not getting set
>>
>> GPIO direction flags are not getting set because
>> an 'if' statement is the wrong way around.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>
> Oopps that's a bug, patch applied for fixes, so it'll work when
> this hits upstream.
>
> Alex: confirm?

Oh yes absolutely, this was a mistake of mine. Thanks and sorry for
the inconvenience.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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