[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdaD2K4L+dF3iaXqQTsYJpoVRnRnp-4La38BWC3cRVUm7g@mail.gmail.com>
Date: Mon, 11 Aug 2014 09:26:49 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Mark Brown <broonie@...nel.org>
Cc: Alexandre Courbot <gnurou@...il.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linaro-kernel <linaro-kernel@...ts.linaro.org>,
Mark Brown <broonie@...aro.org>
Subject: Re: [PATCH] gpiolib: Don't allow drivers to specify a base with DT
On Thu, Jul 31, 2014 at 2:07 PM, Mark Brown <broonie@...nel.org> wrote:
> From: Mark Brown <broonie@...aro.org>
>
> DT based systems should have no reason to use fixed GPIO numbers but some
> drivers that work on both DT and non-DT platforms specify them anyway. In
> order to improve robustness in cases where drivers use gpio_is_valid() to
> check for a valid GPIO on data initialized to zero as a default and avoid
> bugs due to assuptions about fixed numbers creeping in ignore any specified
> base when DT is in use.
Hm in principle you are right...
> - if (base < 0) {
> + if (base < 0 || of_have_populated_dt()) {
> base = gpiochip_find_base(chip->ngpio);
But here I worry about breaking in-transition systems, e.g.
defining part of the peripherals through DT but adding a
GPIO device with AUXDATA, setting up base that way.
Not that it should stay that way for sure, but it does need
some consideration...
Yours,
Linus Walleij
--
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