On Thu, Jul 31, 2014 at 2:07 PM, Mark Brown broonie@kernel.org wrote:
From: Mark Brown broonie@linaro.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