diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2019-07-08 10:23:43 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2019-07-28 12:44:14 +0200 |
commit | ffe0bbabb0cffceceae07484fde1ec2a63b1537c (patch) | |
tree | 09839bccb2f0faef62b3c9b0fef466994da0e659 /drivers/pci | |
parent | 223ecaf140b1dd1c1d2a1a1d96281efc5c906984 (diff) |
gpio: don't WARN() on NULL descs if gpiolib is disabled
If gpiolib is disabled, we use the inline stubs from gpio/consumer.h
instead of regular definitions of GPIO API. The stubs for 'optional'
variants of gpiod_get routines return NULL in this case as if the
relevant GPIO wasn't found. This is correct so far.
Calling other (non-gpio_get) stubs from this header triggers a warning
because the GPIO descriptor couldn't have been requested. The warning
however is unconditional (WARN_ON(1)) and is emitted even if the passed
descriptor pointer is NULL.
We don't want to force the users of 'optional' gpio_get to check the
returned pointer before calling e.g. gpiod_set_value() so let's only
WARN on non-NULL descriptors.
Cc: stable@vger.kernel.org
Reported-by: Claus H. Stovgaard <cst@phaseone.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/pci')
0 files changed, 0 insertions, 0 deletions