From: Stephen Warren <swarren@nvidia.com>
To: Belisko Marek <marek.belisko@gmail.com>,
David Rientjes <rientjes@google.com>,
"grant.likely@secretlab.ca" <grant.likely@secretlab.ca>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 2/2] pinmux: Unify pin type from signed to unsigned.
Date: Thu, 27 Oct 2011 08:59:43 -0700 [thread overview]
Message-ID: <74CDBE0F657A3D45AFBB94109FB122FF173E1B48AB@HQMAIL01.nvidia.com> (raw)
In-Reply-To: <CAAfyv35KsspWGAkmZmZOaDw5v3tngKuV8YqQ_fvZU4azHCUtYA@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2286 bytes --]
Belisko Marek wrote at Thursday, October 27, 2011 12:13 AM:
> On Wed, Oct 26, 2011 at 11:06 PM, David Rientjes <rientjes@google.com> wrote:
> > On Wed, 26 Oct 2011, Marek Belisko wrote:
> >
> >> diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
> >> index 3605e94..34c33c7 100644
> >> --- a/include/linux/pinctrl/pinctrl.h
> >> +++ b/include/linux/pinctrl/pinctrl.h
> >> @@ -112,7 +112,7 @@ struct pinctrl_desc {
> >> Â extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
> >> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â struct device *dev, void *driver_data);
> >> Â extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
> >> -extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
> >> +extern bool pin_is_valid(struct pinctrl_dev *pctldev, unsigned int pin);
> >> Â extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
> >> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â struct pinctrl_gpio_range *range);
> >> Â extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
> >> @@ -123,7 +123,7 @@ extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
> >>
> >>
> >> Â /* Sufficiently stupid default function when pinctrl is not in use */
> >> -static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin)
> >> +static inline bool pin_is_valid(struct pinctrl_dev *pctldev, unsigned int pin)
> >> Â {
> >> Â Â Â return pin >= 0;
> >> Â }
> >
> >
> > So this would just become return true, right?
>
> Right I've overlooked it. Will send update version.
I wonder if the type shouldn't be signed consistently rather than unsigned,
since a signed value, -1, is typically used to indicate "invalid pin".
I wonder if the dummy pin_is_valid() should actually return false rather
than true; that's what <linux/gpio.h> does, but asm-generic/gpio.h always
returns true, like your updated pinctrl patch would.
Looking at include/linux/gpio.h, gpiolib has the same issue with signed/
unsigned inconsistency. Whatever solution we pick for pinctrl should be
consistent with gpiolib; Grant should comment here.
--
nvpublic
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2011-10-27 15:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-26 20:57 [PATCH 1/2] pinmux: Remove double pin validity check Marek Belisko
2011-10-26 20:57 ` [PATCH 2/2] pinmux: Unify pin type from signed to unsigned Marek Belisko
2011-10-26 21:06 ` David Rientjes
2011-10-27 6:13 ` Belisko Marek
2011-10-27 15:59 ` Stephen Warren [this message]
2011-10-28 19:53 ` Linus Walleij
2011-10-31 20:27 ` [PATH v2 " Marek Belisko
2011-11-11 14:38 ` Linus Walleij
2011-10-27 16:37 ` [PATCH 1/2] pinmux: Remove double pin validity check Stephen Warren
2011-10-27 18:39 ` Belisko Marek
2011-10-27 18:42 ` Stephen Warren
2011-10-28 19:47 ` 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=74CDBE0F657A3D45AFBB94109FB122FF173E1B48AB@HQMAIL01.nvidia.com \
--to=swarren@nvidia.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.belisko@gmail.com \
--cc=rientjes@google.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®