All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Alexandre Courbot <acourbot@nvidia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] gpio: make of_get_named_gpiod_flags() private
Date: Mon, 19 May 2014 15:28:23 +0200	[thread overview]
Message-ID: <20140519132822.GA9728@ulmo> (raw)
In-Reply-To: <1400306090-4092-1-git-send-email-acourbot@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 1677 bytes --]

On Sat, May 17, 2014 at 02:54:50PM +0900, Alexandre Courbot wrote:
> of_get_named_gpiod_flags() is visible and directly usable by GPIO
> consumers, but it really should not as the gpiod interface relies
> on the simpler gpiod_get() to provide properly-configured GPIOs.
> 
> of_get_named_gpiod_flags() is just used internally by gpiolib to
> implement gpiod_get(), and by the old of_get_named_gpio_flags()
> function, therefore it makes sense to make it gpiolib-private.
> 
> As a side-effect, the unused (and unneeded) of_get_gpiod_flags()
> inline function is also removed, and of_get_named_gpio_flags() is moved
> from a static inline function to a regular one in gpiolib-of.c
> 
> This results in all references to gpiod_* functions in of_gpio.h being
> gone, which is the way it should be since this file is part of the old
> integer GPIO interface.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
> Changes since v1:
> - Fixed compilation error when CONFIG_OF_GPIO is not defined
> - Fixed warning due to of_gpio_flags enum not being declared
>   in private gpiolib.h header
> 
>  drivers/gpio/gpiolib-of.c | 14 ++++++++++++++
>  drivers/gpio/gpiolib.h    |  5 +++++
>  include/linux/of_gpio.h   | 35 +++--------------------------------
>  3 files changed, 22 insertions(+), 32 deletions(-)

There are cases where GPIOs need to be obtained from device tree nodes
without a corresponding struct device. Do you have any ideas on how to
support such use-cases?

There's currently no API to do that except of_get_named_gpio_flags().
But that doesn't handled flags automatically in a way that gpiod_get()
does.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-05-19 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-17  5:54 [PATCH v2] gpio: make of_get_named_gpiod_flags() private Alexandre Courbot
2014-05-19 13:28 ` Thierry Reding [this message]
2014-05-19 15:07   ` Alexandre Courbot
2014-05-19 15:15     ` Thierry Reding
2014-05-21  9:16 ` Linus Walleij
2014-05-23  3:34   ` Alexandre Courbot
2014-05-23  7:34     ` Linus Walleij

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=20140519132822.GA9728@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=acourbot@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.