On Mon, Jan 8, 2018 at 9:02 AM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote: > Before it was clearly established that all GPIO properties in the > device tree shall be named "foo-gpios" (with the deprecated variant > "foo-gpio" for single lines) we unfortunately merged a few bindings > which named the lines "gpio-foo" instead. > > This is most prominent in the GPIO SPI driver in Linux which names > the lines "gpio-sck", "gpio-mosi" and "gpio-miso". > > As we want to switch the GPIO SPI driver to using descriptors, we > need devm_gpiod_get() to return something reasonable when looking > up these in the device tree. > > Put in a special #ifdef:ed kludge to do this special lookup only > for the SPI case and gets compiled out if we're not enabling SPI. > If we have more oddly defined legacy GPIOs like this, they can be > handled in a similar manner. > > Cc: Rob Herring <robh@xxxxxxxxxx> > Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> > --- > ChangeLog v2->v3: > - Put the if(!IS_ENABLED()) inside the SPI GPIO retrieveal function > and rely on the compiler to stub out unused code. > ChangeLog v1->v2: > - Us if IS_ENABLED(CONFIG_SPI_MASTER) instead of > #ifdef CONFIG_SPI_MASTER > --- > drivers/gpio/gpiolib-of.c | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) Reviewed-by: Rob Herring <robh@xxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html