linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] GPIOD, OF: parse flags into gpiod
Date: Tue, 6 May 2014 01:46:23 +0900	[thread overview]
Message-ID: <CAAVeFuLgm6seqG_rGkdRdkTwrRQHiQdOa_HK_5_8PBNbgPLv1A@mail.gmail.com> (raw)
In-Reply-To: <CAAVeFuL22kTEy+QZgPE8ZTVGkD9N1dMx1m+7AxjkPPD=s+oriw@mail.gmail.com>

On Tue, May 6, 2014 at 12:14 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
>> Let's consider my use case for a minute here. I use a table to get gpios
>> from a dt node:
>>
>>     /* parse GPIOs */
>>     for (; *pin_desc; pin_desc++, gpios++) {
>>
>>         index = of_property_match_string(np, "gpio-names",
>> (*pin_desc)->name);
>>         if (index >= 0)
>>             *gpios = of_get_gpiod_flags(np, index, NULL);
>>
>>         [...]
>>
>>     }
>>
>> Now I had no way of knowing that I'm not supposed to use of_get_gpiod_flags.
>> Because every other driver uses of_get_gpio(_flags), I used the similarly
>> named *public* gpiolib functions, because I like the concept of opaque gpio
>> descriptors.
>
> I am not seeing this "gpio-names" property being used anywhere in
> mainline to lookup GPIOs, nor do I see usages of of_get_gpiod_flags()
> outside of gpiolib, so I had no way of knowing you decided to use it.
>
> Besides I don't have a high-level view on your code, but (at first
> sight) couldn't your call to of_get_gpiod_flags() simply be replaced
> by gpiod_get()?

That was meant to read gpiod_get_index(), sorry for the confusion.

Alex.

  reply	other threads:[~2014-05-05 16:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 12:38 [PATCH] GPIOD, OF: parse flags into gpiod Robert ABEL
2014-05-01  6:24 ` Alexandre Courbot
2014-05-05 10:07   ` Robert Abel
2014-05-05 10:27   ` Robert Abel
2014-05-05 13:10     ` Alexandre Courbot
2014-05-05 14:08       ` Robert ABEL
2014-05-05 15:14         ` Alexandre Courbot
2014-05-05 16:46           ` Alexandre Courbot [this message]
2014-05-13 12:19           ` Robert ABEL
2014-05-13 13:38             ` Javier Martinez Canillas
2014-05-14  0:44               ` Robert Abel
2014-05-14  4:09                 ` Alexandre Courbot
2014-05-13 14:24             ` Alexandre Courbot
2014-05-16 15:49               ` Linus Walleij
2014-05-13  8:42 ` Linus Walleij
2014-05-13 11:33   ` Robert ABEL
2014-05-13 13:20     ` 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=CAAVeFuLgm6seqG_rGkdRdkTwrRQHiQdOa_HK_5_8PBNbgPLv1A@mail.gmail.com \
    --to=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=rabel@cit-ec.uni-bielefeld.de \
    /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).