All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: Mark Brown <broonie@kernel.org>
Cc: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>,
	<linux-kernel@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Gokulkrishnan Nagarajan <Gokulkrishnan.Nagarajan@in.bosch.com>
Subject: Re: [PATCH] regulator: core: GPIO #0 is a valid GPIO
Date: Mon, 1 Sep 2014 09:46:54 +0200	[thread overview]
Message-ID: <5404246E.4090908@de.bosch.com> (raw)
In-Reply-To: <20140829190129.GZ29327@sirena.org.uk>

On 29.08.2014 21:01, Mark Brown wrote:
> On Fri, Aug 29, 2014 at 10:19:16PM +0400, Dmitry Eremin-Solenikov wrote:
>> From: Dirk Behme <dirk.behme@de.bosch.com>
>>
>> With GPIO #0, this if statement will always fail. Remove this, the
>> check for gpio_is_valid() is sufficent here.
>
> No, read the archives


Could you kindly give us a pointer to the relevant thread in the archive?


> this will break boards using zero as default.
> Any current boards should be using DT and so shouldn't be using fixed
> GPIO numbers in the first place which will mean they'll not end up
> getting zero as a valid GPIO.


Hmm? What's wrong with a DT entry

<&gpio1 0 0>;

for ena_gpio resulting in zero as a valid GPIO?


> If you are using zero as a GPIO for some
> reason provide a way to specify that the GPIO is a real GPIO and not
> just the default value for the struct.


Do you want to say that GPIO #0 (<&gpio1 0 0>;) isn't a valid GPIO for 
config->ena_gpio?


I wonder how this fits to

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/gpio/gpio-legacy.txt

"GPIOs are identified by unsigned integers in the range 0..MAX_INT"

"If you want to initialize a structure with an invalid GPIO number, use
some negative number (perhaps "-EINVAL");"

then?


Best regards

Dirk

  reply	other threads:[~2014-09-01  7:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 18:19 [PATCH] regulator: core: GPIO #0 is a valid GPIO Dmitry Eremin-Solenikov
2014-08-29 19:01 ` Mark Brown
2014-09-01  7:46   ` Dirk Behme [this message]
2014-09-01  7:55     ` Geert Uytterhoeven
2014-09-01 10:15     ` Mark Brown
2014-09-01 11:59       ` Dmitry Eremin-Solenikov
2014-09-01 12:06         ` Mark Brown
2014-09-01 12:35           ` Dmitry Eremin-Solenikov
2014-09-01 12:49             ` Mark Brown
2014-09-03  9:04               ` Dmitry Eremin-Solenikov
2014-09-03 11:01                 ` Mark Brown
2014-09-04 17:15         ` Linus Walleij
2014-09-04 17:19     ` 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=5404246E.4090908@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=Gokulkrishnan.Nagarajan@in.bosch.com \
    --cc=broonie@kernel.org \
    --cc=dmitry_eremin@mentor.com \
    --cc=lgirdwood@gmail.com \
    --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.