]> asedeno.scripts.mit.edu Git - linux.git/commit
gpio: return NULL from gpiod_get_optional when GPIOLIB is disabled
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 13 Feb 2017 01:13:55 +0000 (17:13 -0800)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 15 Mar 2017 10:16:30 +0000 (11:16 +0100)
commit22c403676dbbb7c6f186099527af7f065498ef45
treeb4c165eee3ec51b83a17bd1d62f5e0851d28287c
parent85c73d50e57eb8ad43955fe38714bc5fba1acd92
gpio: return NULL from gpiod_get_optional when GPIOLIB is disabled

Given the intent behind gpiod_get_optional() and friends it does not make
sense to return -ENOSYS when GPIOLIB is disabled: the driver is expected to
work just fine without gpio so let's behave as if gpio was not found.
Otherwise we have to special-case -ENOSYS in drivers.

Note that there was objection that someone might forget to enable GPIOLIB
when dealing with a platform that has device that actually specifies
optional gpio and we'll break it. I find this unconvincing as that would
have to be the *only GPIO* in the system, which is extremely unlikely.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Documentation/gpio/consumer.txt
include/linux/gpio/consumer.h