From: NeilBrown <neilb@suse.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-kernel@vger.kernel.org,
Grant Likely <grant.likely@secretlab.ca>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [GIT PULL] GPIO changes for v3.6
Date: Mon, 30 Jul 2012 16:57:33 +1000 [thread overview]
Message-ID: <20120730165733.33e3ddfb@notabene.brown> (raw)
In-Reply-To: <CACRpkdZnRiZpKuQ6krJFa8TAfmvYYLB-n79ztzaUOV32p6ZY1Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]
On Thu, 26 Jul 2012 00:48:57 +0200 Linus Walleij <linus.walleij@linaro.org>
wrote:
> Hi Linus,
>
> in Grants absence, these are my queued and -next-tested changes
> for v3.6, please pull them in. Grants "merge" branch prior to his
> absence was merged in as a base for this patch series.
>
> The following is the same information as found in the tag:
>
> GPIO changes for v3.6:
> - New driver for AMD-8111 southbridge GPIOs
> - New driver for Wolfson Micro Arizona devices
> - Propagate device tree parse errors
> - Probe deferral finalizations - all expected calls to
> GPIO will now hopefully request deferral where apropriate
> - Misc updates to TCA6424, WM8994, LPC32xx, PCF857x, Samsung
> MXC, OMAP and PCA953X drivers.
>
..
> Mark Brown (5):
> gpiolib: Defer failed gpio requests by default
Hi,
this doesn't look quite right to me.
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.
I would suggest the following. Reasonable?
NeilBrown
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index de0213c..259233b 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1186,13 +1186,14 @@ int gpio_request(unsigned gpio, const char *label)
{
struct gpio_desc *desc;
struct gpio_chip *chip;
- int status = -EPROBE_DEFER;
+ int status = -EINVAL;
unsigned long flags;
spin_lock_irqsave(&gpio_lock, flags);
if (!gpio_is_valid(gpio))
goto done;
+ status = -EPROBE_DEFER;
desc = &gpio_desc[gpio];
chip = desc->chip;
if (chip == NULL)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2012-07-30 6:57 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 [this message]
2012-07-30 13:36 ` Mark Brown
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=20120730165733.33e3ddfb@notabene.brown \
--to=neilb@suse.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox