linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <acourbot@nvidia.com>,
	Mark Brown <broonie@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Arnd Bergmann <arnd@arndb.de>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: add flags argument to gpiod_get*() functions
Date: Mon, 4 Aug 2014 14:04:12 +0900	[thread overview]
Message-ID: <CAAVeFuJm6EOseDow9Mr27FaqucdARaQvXTb3FxA13kqnRw3a3w@mail.gmail.com> (raw)
In-Reply-To: <CAAVeFuK0qe9Hi8OZv9pJjZYFZB_DexPJOD-D2=4DSG==7nHkJg@mail.gmail.com>

On Thu, Jul 31, 2014 at 12:43 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Mon, Jul 28, 2014 at 7:30 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Fri, Jul 25, 2014 at 4:38 PM, Alexandre Courbot <acourbot@nvidia.com> wrote:
>>
>>> The huge majority of GPIOs have their direction and initial value set
>>> right after being obtained by one of the gpiod_get() functions. The
>>> integer GPIO API had gpio_request_one() that took a convenience flags
>>> parameter allowing to specify an direction and value applied to the
>>> returned GPIO. This feature greatly simplifies client code and ensures
>>> errors are always handled properly.
>>>
>>> A similar feature has been requested for the gpiod API. Since setting
>>> the direction of a GPIO is so often the very next action done after
>>> obtaining its descriptor, we prefer to extend the existing functions
>>> instead of introducing new functions that would raise the
>>> number of gpiod getters to 16 (!).
>>>
>>> The drawback of this approach is that all gpiod clients need to be
>>> updated. To limit the pain, temporary macros are introduced that allow
>>> gpiod_get*() to be called with or without the extra flags argument. They
>>> will be removed once all consumer code has been updated.
>>>
>>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>>> ---
>>> This dude can be applied harmlessly to the GPIO tree - then I will go
>>> after every gpiod user to update the calls to gpiod_get*() before
>>> removing the macros in consumer.h.
>>
>> OK I trust you. Patch applied with Broonie's review tag.
>
> Thanks! Unfortunately it is still not in -next due to a build error...
>
>> Just so we don't forget how we should move forward: Alex what do
>> you think about adding a drivers/gpio/TODO.TXT file outlining the
>> overall plan of the gpiod refactoring and clean-up work?
>
> I have such a file locally - I'm not sure if checking it into the
> kernel tree is relevant though. Sounds more like the task of a wiki
> page.

FWIW I have posted a small list of stuff I intent to do shortly:
https://gist.github.com/Gnurou/a62915acbfe0d0d4a671

      reply	other threads:[~2014-08-04  5:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 14:38 [PATCH] gpio: add flags argument to gpiod_get*() functions Alexandre Courbot
2014-07-25 16:15 ` Mark Brown
2014-07-28 10:30 ` Linus Walleij
2014-07-31  3:43   ` Alexandre Courbot
2014-08-04  5:04     ` Alexandre Courbot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAVeFuJm6EOseDow9Mr27FaqucdARaQvXTb3FxA13kqnRw3a3w@mail.gmail.com \
    --to=gnurou@gmail.com \
    --cc=acourbot@nvidia.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).