gpiolib: Check "gpio-ranges" before calling ->add_pin_ranges()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 13 Jan 2023 21:53:49 +0000 (23:53 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 26 Jan 2023 12:38:55 +0000 (13:38 +0100)
commitc40aa80dd4569848ac89454321fa035a6ca26976
tree31bd37a9e4e9966afe8393cfc35abbf3b951090f
parent6eea5a80d2ae9bc1df5664bcf7851306df96e9dc
gpiolib: Check "gpio-ranges" before calling ->add_pin_ranges()

The ->add_pin_ranges() is supposed to be called for the backward
compatiblity on Device Tree platforms or non-DT ones. Ensure that
by checking presense of the "gpio-ranges" property.

This allows to clean up a few existing drivers to avoid duplication
of the check.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20230113215352.44272-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c