Files
i2som-imx-linux/include/linux
Bartosz Golaszewski c9c90711ee gpio: don't WARN() on NULL descs if gpiolib is disabled
[ Upstream commit ffe0bbabb0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-16 08:22:22 +02:00
..
2019-04-20 09:16:05 +02:00
2019-07-03 13:14:48 +02:00
2019-08-09 17:52:28 +02:00
2019-05-31 06:46:18 -07:00
2019-05-04 09:20:11 +02:00
2019-06-11 12:20:52 +02:00
2019-04-17 08:38:45 +02:00
2019-06-17 19:51:56 +02:00