Re: [PATCH] gpiolib: Don't allow drivers to specify a base with DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 31, 2014 at 2:07 PM, Mark Brown <broonie@xxxxxxxxxx> wrote:

> From: Mark Brown <broonie@xxxxxxxxxx>
>
> 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-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux