public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: NeilBrown <neilb@suse.de>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org,
	Grant Likely <grant.likely@secretlab.ca>
Subject: Re: [GIT PULL] GPIO changes for v3.6
Date: Mon, 30 Jul 2012 14:36:15 +0100	[thread overview]
Message-ID: <20120730133614.GA4468@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20120730165733.33e3ddfb@notabene.brown>

On Mon, Jul 30, 2012 at 04:57:33PM +1000, NeilBrown wrote:

> it means that if !gpio_is_valid(gpio), the error returned is EPROBE_DEFER 
> which isn't right (an invalid gpio number will never become valid).
> If a driver happened to use gpio_request to check the validity of the gpio
> rather than doing it itself, it would defer the probe, rather than assume
> that the GPIO doesn't exist.

Is anything actually doing this?  For positive numbers that just seems
like it's asking for things to explode, for negative numbers I guess you
can get away with it at the minute though it's obviously not awesome
error handling.

> I would suggest the following.  Reasonable?

TBH I'd actually expect that gpio_is_valid() were checking that there's
a gpio_chip behind the GPIO number, now I look at the implementation
it's very surprising to me that it's just checking the GPIO array bounds
(and also that we remove the need for the fixed size GPIO array which is
just an endless source of annoyance).

  reply	other threads:[~2012-07-30 13:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 22:48 [GIT PULL] GPIO changes for v3.6 Linus Walleij
2012-07-26 20:58 ` Linus Torvalds
2012-07-27 22:37   ` Linus Walleij
2012-07-28 15:34     ` Shawn Guo
2012-07-30  6:57 ` NeilBrown
2012-07-30 13:36   ` Mark Brown [this message]
2012-07-31  4:47     ` NeilBrown
2012-07-31 13:35       ` Mark Brown
2012-08-04 22:03   ` 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=20120730133614.GA4468@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.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