[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51192CC5.9060300@wwwdotorg.org>
Date: Mon, 11 Feb 2013 10:39:17 -0700
From: Stephen Warren <swarren@...dotorg.org>
To: Linus Walleij <linus.walleij@...aro.org>
CC: Grant Likely <grant.likely@...retlab.ca>,
Alexandre Courbot <acourbot@...dia.com>,
Arnd Bergmann <arnd@...db.de>,
linux-arch <linux-arch@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Alexandre Courbot <gnurou@...il.com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Mike Turquette <mturquette@...aro.org>
Subject: Re: [PATCH 6/9] gpiolib: use descriptors internally
On 02/11/2013 07:09 AM, Linus Walleij wrote:
> On Sat, Feb 9, 2013 at 10:17 AM, Grant Likely <grant.likely@...retlab.ca> wrote:
>
>> The ERR_PTR()/IS_ERR() is a horrible pattern for code
>> readability because it breaks the expectations that programmers have for
>> what is and is not a bad pointer. There are decades of history where the
>> test for a bad pointer is 'if (!ptr)'. Not only does ERR_PTR make make
>> that test not work, but the compiler won't tell you when you get it
>> wrong.
>>
>> There are places where ERR_PTR makes sense. Particularly when
>> communicating with userspace where error codes have very specific
>> meanings, but I don't want it in the GPIO subsystem.
>
> OK I disagree but you get to decide.
>
> 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...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists