Skip to content
Commit be1a4b13 authored by Linus Walleij's avatar Linus Walleij
Browse files

gpio: improve error path in gpiolib



At several places the gpiolib will proceed to handle a GPIO
descriptor even if it's ->chip member is NULL and no gpiochip
is associated.

Fix this by checking that both the descriptor cookie *and*
the chip pointer are valid.

Also bail out earlier with more specific diagnostic messages
on missing operations for setting as input/output or debounce.

ChangeLog v1->v2:
- Also return -EIO on gpiod_set_debounce() with missing
  operations in the vtable
- Fix indentations.

Suggested-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Acked-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Reviewed-by: default avatarFrank Rowand <frank.rowand@sonymobile.com>
Cc: Tim Bird <tim.bird@sonymobile.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 6c17aa01
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment