]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: Keep returning EPROBE_DEFER when we should
authorMaxime Ripard <maxime.ripard@bootlin.com>
Wed, 21 Feb 2018 08:11:00 +0000 (09:11 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 27 Feb 2018 08:47:32 +0000 (09:47 +0100)
commit15eb3822bd3bd953fbff4b66233bd4f1181e2f64
treed482c4c72608d9e641b65a8a6a65d015f90096b0
parentbcac507057f6668c45308343ba41f4c91a086136
gpiolib: Keep returning EPROBE_DEFER when we should

Commits 6a004d388f5d ("gpio: of: Support SPI nonstandard GPIO properties")
and ae8c61793c55 ("gpio: of: Support regulator nonstandard GPIO
properties") have introduced a regression in the way error codes from
of_get_named_gpiod_flags are handled.

Previously, those errors codes were returned immediately, but the two
commits mentioned above are now overwriting the error pointer, meaning that
whatever value has been returned will be dropped in favor of whatever the
two new functions will return.

This might not be a big deal except for EPROBE_DEFER, on which GPIOlib
customers will depend on, and that will now be returned as an hard error
which means that they will not probe anymore, instead of gently deferring
their probe.

Since EPROBE_DEFER basically means that we have found a valid property but
there was no GPIO controller registered to handle it, fix this issues by
returning it as soon as we encounter it.

Fixes: 6a004d388f5d ("gpio: of: Support SPI nonstandard GPIO properties")
Fixes: ae8c61793c55 ("gpio: of: Support regulator nonstandard GPIO properties")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
[Fold in fix to the fix]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-of.c