Commit 7691ba06 authored by Linus Walleij's avatar Linus Walleij Committed by Bartosz Golaszewski
Browse files

gpio: Further document optional GPIOLIB



Optional GPIOLIB as in not depended on or selected by a driver
should NOT use any *_optional() calls, this becomes paradoxical.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent e404b0cc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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