From: Paul Mundt <lethal@linux-sh.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
Grant Likely <grant.likely@secretlab.ca>,
Alexandre Courbot <acourbot@nvidia.com>,
Arnd Bergmann <arnd@arndb.de>,
linux-arch <linux-arch@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Alexandre Courbot <gnurou@gmail.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Mike Turquette <mturquette@linaro.org>
Subject: Re: [PATCH 6/9] gpiolib: use descriptors internally
Date: Wed, 13 Feb 2013 00:59:28 +0900 [thread overview]
Message-ID: <20130212155927.GE6088@linux-sh.org> (raw)
In-Reply-To: <CACRpkdaHuv7CXCy15-o94G0r0+2BStsi34ZVbBAhyGj=U3xgOg@mail.gmail.com>
On Tue, Feb 12, 2013 at 01:29:10PM +0100, Linus Walleij wrote:
> On Mon, Feb 11, 2013 at 6:39 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> > On 02/11/2013 07:09 AM, Linus Walleij wrote:
>
> >> However if you take this all the way to the descriptor API
> >> it will make the consumer (driver) API for GPIO descriptors deviate
> >> from what is today used for clocks, regulators and pins.
> >>
> >> With all the resulting confusion for users.
> >> I've seen worse subsystem deviations though.
> >
> > Sorry I haven't looked at the specific APIs this discussion refers to,
> > but clients of the GPIO descriptor API are going to need to distinguish
> > "fail" from "deferred probe", so at least some initial get-like API will
> > need to pass back some error detail...
>
> Right, so in some other patch I stated that this would lead
> to a GPIO descriptor fetch interface such as this:
>
> int gpiod_get(struct gpiod_desc **gpiod, struct device *dev, const char *name);
>
> Rather than the more established:
>
> struct gpio_desc *gpiod_get(struct device *dev, const char *name);
>
> And I'm worried about the lack of consistency.
>
> While I do get the point... I chatted with Grant about it and
> I want to talk to some toolchain people about this to see if
> pointers containing potential error codes can somehow be
> "flagged" by the compiler so we can enforce error checking on
> them. (It may sound a bit utopic...)
>
At the very least you can __must_check annotate, although that's probably
still a bit coarser grained than what you're after.
WARNING: multiple messages have this Message-ID (diff)
From: lethal@linux-sh.org (Paul Mundt)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/9] gpiolib: use descriptors internally
Date: Wed, 13 Feb 2013 00:59:28 +0900 [thread overview]
Message-ID: <20130212155927.GE6088@linux-sh.org> (raw)
In-Reply-To: <CACRpkdaHuv7CXCy15-o94G0r0+2BStsi34ZVbBAhyGj=U3xgOg@mail.gmail.com>
On Tue, Feb 12, 2013 at 01:29:10PM +0100, Linus Walleij wrote:
> On Mon, Feb 11, 2013 at 6:39 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> > On 02/11/2013 07:09 AM, Linus Walleij wrote:
>
> >> However if you take this all the way to the descriptor API
> >> it will make the consumer (driver) API for GPIO descriptors deviate
> >> from what is today used for clocks, regulators and pins.
> >>
> >> With all the resulting confusion for users.
> >> I've seen worse subsystem deviations though.
> >
> > Sorry I haven't looked at the specific APIs this discussion refers to,
> > but clients of the GPIO descriptor API are going to need to distinguish
> > "fail" from "deferred probe", so at least some initial get-like API will
> > need to pass back some error detail...
>
> Right, so in some other patch I stated that this would lead
> to a GPIO descriptor fetch interface such as this:
>
> int gpiod_get(struct gpiod_desc **gpiod, struct device *dev, const char *name);
>
> Rather than the more established:
>
> struct gpio_desc *gpiod_get(struct device *dev, const char *name);
>
> And I'm worried about the lack of consistency.
>
> While I do get the point... I chatted with Grant about it and
> I want to talk to some toolchain people about this to see if
> pointers containing potential error codes can somehow be
> "flagged" by the compiler so we can enforce error checking on
> them. (It may sound a bit utopic...)
>
At the very least you can __must_check annotate, although that's probably
still a bit coarser grained than what you're after.
next prev parent reply other threads:[~2013-02-12 16:00 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-02 16:29 [PATCH 0/9] gpiolib: remove gpio_desc[] static array Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-02 16:29 ` [PATCH 1/9] gpiolib: link all gpio_chips using a list Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 17:00 ` Linus Walleij
2013-02-05 17:00 ` Linus Walleij
2013-02-09 9:20 ` Grant Likely
2013-02-09 9:20 ` Grant Likely
2013-02-02 16:29 ` [PATCH 2/9] gpiolib: use gpio_chips list in gpiolib_sysfs_init Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 17:04 ` Linus Walleij
2013-02-05 17:04 ` Linus Walleij
2013-02-09 9:22 ` Grant Likely
2013-02-09 9:22 ` Grant Likely
2013-02-09 9:22 ` Grant Likely
2013-02-02 16:29 ` [PATCH 3/9] gpiolib: use gpio_chips list in gpiochip_find Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 17:05 ` Linus Walleij
2013-02-05 17:05 ` Linus Walleij
2013-02-09 9:25 ` Grant Likely
2013-02-09 9:25 ` Grant Likely
2013-02-09 9:25 ` Grant Likely
2013-02-02 16:29 ` [PATCH 4/9] gpiolib: use gpio_chips list in sysfs ops Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 17:15 ` Linus Walleij
2013-02-05 17:15 ` Linus Walleij
2013-02-09 9:37 ` Grant Likely
2013-02-09 9:37 ` Grant Likely
2013-02-09 9:37 ` Grant Likely
2013-02-09 13:53 ` Alexandre Courbot
2013-02-09 13:53 ` Alexandre Courbot
2013-02-02 16:29 ` [PATCH 5/9] gpiolib: use gpio_chips list in gpiochip_find_base Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 17:21 ` Linus Walleij
2013-02-05 17:21 ` Linus Walleij
2013-02-06 4:48 ` Alex Courbot
2013-02-06 4:48 ` Alex Courbot
2013-02-09 9:47 ` Grant Likely
2013-02-09 9:47 ` Grant Likely
2013-02-02 16:29 ` [PATCH 6/9] gpiolib: use descriptors internally Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 17:53 ` Linus Walleij
2013-02-05 17:53 ` Linus Walleij
2013-02-07 6:57 ` Alexandre Courbot
2013-02-07 6:57 ` Alexandre Courbot
2013-02-09 9:17 ` Grant Likely
2013-02-09 9:17 ` Grant Likely
2013-02-09 9:17 ` Grant Likely
2013-02-11 14:09 ` Linus Walleij
2013-02-11 14:09 ` Linus Walleij
2013-02-11 15:40 ` Paul Mundt
2013-02-11 15:40 ` Paul Mundt
2013-02-11 17:39 ` Stephen Warren
2013-02-11 17:39 ` Stephen Warren
2013-02-12 12:29 ` Linus Walleij
2013-02-12 12:29 ` Linus Walleij
2013-02-12 15:59 ` Paul Mundt [this message]
2013-02-12 15:59 ` Paul Mundt
2013-02-12 17:18 ` Arnd Bergmann
2013-02-12 17:18 ` Arnd Bergmann
2013-02-09 13:11 ` Grant Likely
2013-02-09 13:11 ` Grant Likely
2013-02-09 13:11 ` Grant Likely
2013-02-09 13:11 ` Grant Likely
2013-02-09 14:15 ` Alexandre Courbot
2013-02-09 14:15 ` Alexandre Courbot
2013-02-09 13:24 ` Grant Likely
2013-02-09 13:24 ` Grant Likely
2013-02-09 13:24 ` Grant Likely
2013-02-09 13:24 ` Grant Likely
2013-02-09 14:18 ` Alexandre Courbot
2013-02-09 14:18 ` Alexandre Courbot
2013-02-02 16:29 ` [PATCH 7/9] gpiolib: let gpio_chip reference its descriptors Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 18:00 ` Linus Walleij
2013-02-05 18:00 ` Linus Walleij
2013-02-09 13:28 ` Grant Likely
2013-02-09 13:28 ` Grant Likely
2013-02-02 16:29 ` [PATCH 8/9] gpiolib: use gpio_chips list in gpio_to_desc Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 18:01 ` Linus Walleij
2013-02-05 18:01 ` Linus Walleij
2013-02-05 18:01 ` Linus Walleij
2013-02-09 9:58 ` Grant Likely
2013-02-09 9:58 ` Grant Likely
2013-02-09 9:58 ` Grant Likely
2013-02-09 9:58 ` Grant Likely
2013-02-09 14:21 ` Alexandre Courbot
2013-02-09 14:21 ` Alexandre Courbot
2013-02-09 14:37 ` Grant Likely
2013-02-09 14:37 ` Grant Likely
2013-02-02 16:29 ` [PATCH 9/9] gpiolib: dynamically allocate descriptors array Alexandre Courbot
2013-02-02 16:29 ` Alexandre Courbot
2013-02-05 18:02 ` Linus Walleij
2013-02-05 18:02 ` 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=20130212155927.GE6088@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=acourbot@nvidia.com \
--cc=arnd@arndb.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gnurou@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=swarren@wwwdotorg.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.