mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: "Holmberg\, Hans" <hans.holmberg@intel.com>,
	Tyler Hall <tylerwhall@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	"linux-gpio\@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"devicetree\@vger.kernel.org" <devicetree@vger.kernel.org>,
	Daniel Mack <zonque@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Howard Cochran <cochran@lexmark.com>
Subject: Re: gpio-pxa: getting GPIOs by devicetree phandle broken
Date: Mon, 09 Feb 2015 18:38:39 +0100	[thread overview]
Message-ID: <87mw4n6l40.fsf@free.fr> (raw)
In-Reply-To: <CAOjnSCZgx5H75t8QrXj1WQ_SaU_4HDYeK+_XdBRmwUXzHW=iJw@mail.gmail.com> (Tyler Hall's message of "Mon, 9 Feb 2015 09:41:17 -0500")

Tyler Hall <tylerwhall@gmail.com> writes:

>> The issue with multiple gpiochips per of-node could be worked around as followed I believe, comments?
>>
>> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
>> index 08261f2..43984ab 100644
>> --- a/drivers/gpio/gpiolib-of.c
>> +++ b/drivers/gpio/gpiolib-of.c
>> @@ -47,11 +47,12 @@ static int of_gpiochip_find_and_xlate(struct gpio_chip *gc, void *data)
>>         ret = gc->of_xlate(gc, &gg_data->gpiospec, gg_data->flags);
>>         if (ret < 0) {
>>                 /* We've found the gpio chip, but the translation failed.
>> -                * Return true to stop looking and return the translation
>> -                * error via out_gpio
>> +                * Store translation error in out_gpio.
>> +                * Return false to keep looking, as more than one GPIO chip
>> +                * could be registered per of-node.
>>                  */
>>                 gg_data->out_gpio = ERR_PTR(ret);
>> -               return true;
>> +               return false;
>>          }
>>
>>         gg_data->out_gpio = gpiochip_get_desc(gc, ret);
>
> As long as we're ok with multiple gpiochips per of-node, this would
> work for me. It'll change the preference of which chip returns the
> error in the case of multiple chips, but that's already undefined
> behavior.

Looks good to me too, this will solve my issue, and the global behavior would be
consistent with the former one.

Would you care submitting a proper patch so that we can apply our Reviewed-by,
Tested-by etc ... ?

Cheers.

-- 
Robert

  reply	other threads:[~2015-02-09 17:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 21:28 Tyler Hall
2015-02-09  6:11 ` Alexandre Courbot
2015-02-09  8:02   ` Robert Jarzmik
2015-02-09  9:42   ` Holmberg, Hans
2015-02-09 14:41     ` Tyler Hall
2015-02-09 17:38       ` Robert Jarzmik [this message]
2015-02-10  5:33         ` Alexandre Courbot

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=87mw4n6l40.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=cochran@lexmark.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gnurou@gmail.com \
    --cc=hans.holmberg@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tylerwhall@gmail.com \
    --cc=zonque@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

all inboxes | Powered by JetHome®