[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54045FA6.70602@mentor.com>
Date: Mon, 1 Sep 2014 15:59:34 +0400
From: Dmitry Eremin-Solenikov <dmitry_eremin@...tor.com>
To: Mark Brown <broonie@...nel.org>,
Dirk Behme <dirk.behme@...bosch.com>
CC: <linux-kernel@...r.kernel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Gokulkrishnan Nagarajan <Gokulkrishnan.Nagarajan@...bosch.com>,
Grant Likely <grant.likely@...retlab.ca>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH] regulator: core: GPIO #0 is a valid GPIO
On 09/01/2014 02:15 PM, Mark Brown wrote:
> On Mon, Sep 01, 2014 at 09:46:54AM +0200, Dirk Behme wrote:
>> I wonder how this fits to
>
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/gpio/gpio-legacy.txt
>
>> "GPIOs are identified by unsigned integers in the range 0..MAX_INT"
>
>> "If you want to initialize a structure with an invalid GPIO number, use
>> some negative number (perhaps "-EINVAL");"
>
>> then?
>
> There's no practical way to deploy that without breaking users - as soon
> as you treat 0 as a valid GPIO you make all existing users relying on
> the natural behaviour of treating 0 as default instantly buggy which is
> not practical. Really the GPIO API is badly specified here.
>
Back in the time before DTS conversion started, the 0 was a correct GPIO
number. If somebody wanted to specify that no gpio is provided, he
provided -1 as an invalid number. I have the feeling that allowing users
to use 0 as 'no gpio' is a mistake. Or the API should be changed
to disallow GPIO 0 to exist at all.
--
With best wishes
Dmitry
--
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