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-01-22 21:40:33 +01:00
2019-09-10 10:33:53 +01:00
2019-09-16 08:22:22 +02:00
2019-05-31 06:46:24 -07:00
2019-03-13 14:02:35 -07:00
2019-05-22 07:37:41 +02:00
2019-08-09 17:52:33 +02:00
2019-06-25 11:35:53 +08:00
2019-04-17 08:38:46 +02:00
2019-05-08 07:21:54 +02:00
2019-02-27 10:08:52 +01:00
2019-08-04 09:30:56 +02:00
2019-07-03 13:14:46 +02:00
2019-01-26 09:32:34 +01:00
2019-08-06 19:06:50 +02:00
2019-04-20 09:16:05 +02:00
2019-03-05 17:58:50 +01:00
2019-05-31 06:46:00 -07:00
2019-06-09 09:17:11 +02:00
2019-04-17 08:38:51 +02:00
2019-08-04 09:30:57 +02:00
2019-01-31 08:14:41 +01:00
2019-07-03 13:14:48 +02:00
2019-05-25 18:23:48 +02:00
2019-08-16 10:12:38 +02:00
2019-08-09 17:52:34 +02:00
2019-08-09 17:52:34 +02:00
2019-04-05 22:33:03 +02:00
2019-08-06 19:06:52 +02:00
2019-08-06 19:06:52 +02:00
2019-06-09 09:17:23 +02:00
2019-02-27 10:08:53 +01:00
2019-06-09 09:17:23 +02:00
2019-02-27 10:08:53 +01:00
2019-06-04 08:02:34 +02:00
2019-06-11 12:20:52 +02:00
2019-03-10 07:17:15 +01:00
2019-07-26 09:14:12 +02:00
2019-07-31 07:27:11 +02:00
2019-05-25 18:23:26 +02:00
2019-09-16 08:22:12 +02:00
2019-08-09 17:52:28 +02:00
2019-06-04 08:02:34 +02:00
2019-05-16 19:41:22 +02:00
2019-05-16 19:41:17 +02:00
2019-04-05 22:32:59 +02:00
2019-07-10 09:53:47 +02:00
2019-07-28 08:29:29 +02:00
2019-05-31 06:46:18 -07:00
2019-02-12 19:47:14 +01:00
2019-09-10 10:33:44 +01:00
2019-03-23 20:10:08 +01:00
2019-02-12 19:47:24 +01:00
2019-05-31 06:46:28 -07:00
2019-01-13 09:51:04 +01:00
2019-07-31 07:26:59 +02:00
2019-05-22 07:37:40 +02:00
2019-05-22 07:37:40 +02:00
2019-01-31 08:14:36 +01:00
2019-05-08 07:21:43 +02:00
2019-03-05 17:58:51 +01:00
2019-08-09 17:52:34 +02:00
2019-08-04 09:30:54 +02:00
2019-03-05 17:58:45 +01:00
2019-04-05 22:33:09 +02:00
2019-07-28 08:29:29 +02:00
2019-06-04 08:02:34 +02:00
2019-06-04 08:02:34 +02:00
2019-04-20 09:15:59 +02:00
2019-07-21 09:03:11 +02:00
2019-03-23 20:09:48 +01:00
2019-04-27 09:36:37 +02:00
2019-08-16 10:12:53 +02:00
2019-06-09 09:17:19 +02:00
2019-09-06 10:22:19 +02:00
2018-12-29 13:37:59 +01:00
2019-04-17 08:38:51 +02:00
2019-01-13 09:51:04 +01:00
2019-05-04 09:20:11 +02:00
2019-06-09 09:17:23 +02:00
2019-05-31 06:46:05 -07:00
2019-01-09 17:38:42 +01:00
2019-02-23 09:07:25 +01:00
2019-04-27 09:36:30 +02:00
2019-06-04 08:02:34 +02:00
2019-06-04 08:02:34 +02:00
2019-09-06 10:22:22 +02:00
2019-09-06 10:22:23 +02:00
2019-06-09 09:17:24 +02:00
2019-05-31 06:46:30 -07:00
2019-05-25 18:23:38 +02:00
2019-07-28 08:29:28 +02:00
2019-05-04 09:20:11 +02:00
2019-03-23 20:10:04 +01:00
2019-06-11 12:20:52 +02:00
2019-01-09 17:38:33 +01:00
2019-06-15 11:54:10 +02:00
2019-07-26 09:14:07 +02:00
2019-04-05 22:32:56 +02:00
2019-04-05 22:32:56 +02:00
2019-08-04 09:30:56 +02:00
2019-06-04 08:02:30 +02:00
2019-05-25 18:23:20 +02:00
2019-04-03 06:26:28 +02:00
2019-05-31 06:46:16 -07:00
2019-03-13 14:02:35 -07:00
2019-04-17 08:38:45 +02:00
2019-04-20 09:16:05 +02:00
2019-06-17 19:51:56 +02:00
2019-05-31 06:46:29 -07:00
2019-05-08 07:21:44 +02:00
2019-02-27 10:09:01 +01:00
2019-04-17 08:38:52 +02:00
2019-07-14 08:11:21 +02:00