netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rojhalat Ibrahim <imr@rtschenk.de>
To: Alexandre Courbot <gnurou@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	netdev <netdev@vger.kernel.org>,
	David Daney <david.daney@cavium.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <acourbot@nvidia.com>
Subject: Re: [PATCH] mdio-mux-gpio: Use GPIO descriptor interface and new gpiod_set_array function
Date: Tue, 25 Nov 2014 09:13:48 +0100	[thread overview]
Message-ID: <8914633.CtiBEziHQ6@pcimr> (raw)
In-Reply-To: <CAAVeFuKTmQi3vK5vALbT=hseRm9mn=-cb-7hiHwg7Zbczmz_WA@mail.gmail.com>

On Tuesday 25 November 2014 12:39:13 Alexandre Courbot wrote:
> On Thu, Nov 20, 2014 at 9:24 PM, Rojhalat Ibrahim <imr@rtschenk.de> wrote:
> > @@ -70,20 +64,17 @@ static int mdio_mux_gpio_probe(struct platform_device *pdev)
> >         s->num_gpios = num_gpios;
> >
> >         for (n = 0; n < num_gpios; ) {
> > -               int gpio = of_get_gpio_flags(pdev->dev.of_node, n, &f);
> > -               if (gpio < 0) {
> > -                       r = (gpio == -ENODEV) ? -EPROBE_DEFER : gpio;
> > +               struct gpio_desc *gpio = gpiod_get_index(&pdev->dev,
> > +                                                        "mdio-mux-gpio", n);
> 
> Doesn't this change introduce some incompatibility against the current
> DT bindings? of_get_gpio_flags() looks for a "gpios" property, while
> your call to gpiod_get_index() will look for "mdio-mux-gpio-gpios". It
> should probably be changed to gpiod_get_index(&pdev->dev, NULL, n).
> 

You are right, of course. I'll fix it and post a new patch version.

> ... or even be changed to gpiod_get_index(&pdev->dev, NULL, n,
> GPIOD_OUT_LOW) as the calls to gpiod_get() functions are being updated
> to take an initial state (both variants are currently usable but the
> former one will disappear in the future). This will also allow you to
> get rid of your call to gpiod_direction_output().
> 

Will do that.

> Side-note: it would be nice to have a gpiod_get_array() call that does
> exactly what this loop does, and returns an array of gpios directly
> usable by gpiod_set_array*(). And a matching gpiod_put_array() of
> course.
> 

I'll add that to my to-do-list.


Thanks
   Rojhalat


      reply	other threads:[~2014-11-25  8:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20 12:24 [PATCH] mdio-mux-gpio: Use GPIO descriptor interface and new gpiod_set_array function Rojhalat Ibrahim
2014-11-21 20:13 ` David Miller
2014-11-24  8:35   ` Rojhalat Ibrahim
2014-11-24 18:06     ` David Miller
2014-11-25  3:39 ` Alexandre Courbot
2014-11-25  8:13   ` Rojhalat Ibrahim [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=8914633.CtiBEziHQ6@pcimr \
    --to=imr@rtschenk.de \
    --cc=acourbot@nvidia.com \
    --cc=david.daney@cavium.com \
    --cc=f.fainelli@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=netdev@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 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).