]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: Defer failed gpio requests by default
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 9 Jul 2012 11:22:56 +0000 (12:22 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 17 Jul 2012 19:00:20 +0000 (21:00 +0200)
commitd6712f8bd0bc48fcfe3736c3c55bb83a84a0a5aa
tree8dcadb5c002f4b53009afb38bec7d3c6cf92cbb2
parent8df7a6d9c266810fec8c3fa7e55baf190b20c46e
gpiolib: Defer failed gpio requests by default

Since users must be explicitly provided with a GPIO number in order to
request one the overwhelmingly common case for failing to request will
be that the required GPIO driver has not yet registered and we should
therefore defer until it has registered.

In order to avoid having to code this logic in individual drivers have
gpio_request() return -EPROBE_DEFER when failing to look up the GPIO.
Drivers which don't want this behaviour can override it if they desire.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c