From: Stephen Warren <swarren@wwwdotorg.org>
To: Dong Aisheng <b29396@freescale.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linus.walleij@stericsson.com, s.hauer@pengutronix.de
Subject: Re: [PATCH v2 1/2] pinctrl: add pinctrl_provide_dummies interface for platforms to use
Date: Tue, 24 Apr 2012 13:00:23 -0600 [thread overview]
Message-ID: <4F96F847.508@wwwdotorg.org> (raw)
In-Reply-To: <1335260023-15859-1-git-send-email-b29396@freescale.com>
On 04/24/2012 03:33 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
>
> Add a interface pinctrl_provide_dummies for platform to indicate
> whether it needs use pinctrl dummy state and dummy gpio.
> @@ -382,7 +396,12 @@ int pinctrl_request_gpio(unsigned gpio)
> ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
> if (ret) {
> mutex_unlock(&pinctrl_mutex);
> - return -EINVAL;
> + if (pinctrl_dummy_gpio) {
> + pr_debug("pinctrl: using dummy gpio(%u)\n", gpio);
> + return 0;
> + } else {
> + return -EINVAL;
> + }
> }
The only thing that should be calling pinctrl_request_gpio() is a GPIO
driver. It should only be calling it for the GPIOs it manages. I'd
expect that if a platform's pinctrl driver was not yet written to
support the GPIO functionality, then the GPIO driver would not be
calling this function.
As such, I'm not sure that this part of the change is necessary.
If it is, then surely all the other pinctrl GPIO APIs need a similar change?
Finally, how does this interact with deferred probe: How does the code
know whether the pinctrl driver and/or GPIO range is simply not yet
registered, or whether it never will be? That'd be the difference
between returning -EPROBE_DEFER or 0 in the if block above.
I'm fine with the other parts of this patch.
next prev parent reply other threads:[~2012-04-24 19:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-24 9:33 [PATCH v2 1/2] pinctrl: add pinctrl_provide_dummies interface for platforms to use Dong Aisheng
2012-04-24 9:33 ` [PATCH v2 2/2] pinctrl: remove the old pinctrl dt dummy state interfaces Dong Aisheng
2012-04-24 19:04 ` Stephen Warren
2012-04-25 12:05 ` Dong Aisheng
2012-04-24 19:00 ` Stephen Warren [this message]
2012-04-25 9:49 ` [PATCH v2 1/2] pinctrl: add pinctrl_provide_dummies interface for platforms to use Dong Aisheng
2012-04-25 11:19 ` Linus Walleij
2012-04-25 11:49 ` Dong Aisheng
2012-04-25 15:22 ` Stephen Warren
2012-04-26 7:48 ` Dong Aisheng
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=4F96F847.508@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=b29396@freescale.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.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