Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 40c8eaba authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Walleij
Browse files

gpio: Propagate all errors in devm_get_gpiod_from_child()



devm_get_gpiod_from_child() tries several property suffixes to find a
GPIO descriptor. If all suffixes fail and no probe deferral has been
detected, it returns the error of the last try.

However, if any but the last try fails with a real error (e.g. -EBUSY),
this error is not propagated, and -ENOENT will be returned.
This confuses drivers that e.g. want to detect if a GPIO is already in
use.

To fix this, change the loop logic to continue on -ENOENT, which
indicates the property was not found and the next suffix should be
tried, and propagate all other detected errors.

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent bb91d345
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment