From patchwork Mon Sep 22 08:20:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 391814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2002E140174 for ; Mon, 22 Sep 2014 18:21:57 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751058AbaIVIVm (ORCPT ); Mon, 22 Sep 2014 04:21:42 -0400 Received: from mga14.intel.com ([192.55.52.115]:61925 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753387AbaIVIVk (ORCPT ); Mon, 22 Sep 2014 04:21:40 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by fmsmga103.fm.intel.com with ESMTP; 22 Sep 2014 01:12:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,570,1406617200"; d="scan'208";a="479124277" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.97]) ([10.237.72.97]) by azsmga001.ch.intel.com with ESMTP; 22 Sep 2014 01:21:36 -0700 Message-ID: <541FDBC0.4020302@intel.com> Date: Mon, 22 Sep 2014 11:20:16 +0300 From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Linus Walleij , Alexandre Courbot CC: Ulf Hansson , linux-mmc , Chris Ball , linux-gpio@vger.kernel.org Subject: Re: [PATCH 1/4] mmc: slot-gpio: switch to use flags when getting GPIO References: <1409137253-25189-1-git-send-email-linus.walleij@linaro.org> In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On 08/29/2014 03:16 PM, Ulf Hansson wrote: > On 27 August 2014 13:00, Linus Walleij 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 header, in >> the future we will make the flags argument compulsory. >> >> Reviewed-by: Alexandre Courbot >> Signed-off-by: Linus Walleij > > Thanks! Applied for next. Unfortunately it doesn't seem to work. I needed the patch below. From: Adrian Hunter 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 --- drivers/gpio/gpiolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */