gpio: Further document optional GPIOLIB
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 2 Oct 2023 08:12:47 +0000 (10:12 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 4 Oct 2023 11:40:44 +0000 (13:40 +0200)
Optional GPIOLIB as in not depended on or selected by a driver
should NOT use any *_optional() calls, this becomes paradoxical.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Documentation/driver-api/gpio/consumer.rst

index de6fc79ad6f03d67ab144fcd4fb3963cf1a5a3e3..3e588b9d678cf93d3011af0497ab271e2f4eae65 100644 (file)
@@ -29,6 +29,10 @@ warnings. These stubs are used for two use cases:
   will use it under other compile-time configurations. In this case the
   consumer must make sure not to call into these functions, or the user will
   be met with console warnings that may be perceived as intimidating.
+  Combining truly optional GPIOLIB usage with calls to
+  ``[devm_]gpiod_get_optional()`` is a *bad idea*, and will result in weird
+  error messages. Use the ordinary getter functions with optional GPIOLIB:
+  some open coding of error handling should be expected when you do this.
 
 All the functions that work with the descriptor-based GPIO interface are
 prefixed with ``gpiod_``. The ``gpio_`` prefix is used for the legacy